PEP-272: тест зависшего раннера ждёт, пока экран устоится, вместо паузы 1,5 с
All checks were successful
peppa/lint lint: success за 2с
peppa/typecheck typecheck: success за 52с
peppa/build build: success за 38с
peppa/test test: success за 1580с
peppa-ci / ci (pull_request) Successful in 28m35s

Под нагрузкой CI ответ мок-агента дорисовывался между тиками, вачдог видел активность.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
peppa-bot 2026-11-26 21:13:37 +00:00
parent ce03df667c
commit 1341d61a05

View File

@ -129,7 +129,18 @@ describe("Зависший раннер перезапускается", () => {
const p = await storyAtWork({ turns: [[{ say: "Думаю." }, { hang: true }]], resumeTurns: [[{ say: "Отвис." }]] });
const sid = await p.start();
await p.waitLog("turn 0", (e) => e.ev === "prompt");
await new Promise((r) => setTimeout(r, 1500));
// The hung agent's screen must settle first: under a loaded CI a fixed pause was too short, the
// reply landed between ticks and the watchdog rightly saw "activity" (PEP-272 CI run 360).
const pane = (await sess(sid)).tmuxName;
await waitFor("hung reply on screen", async () => (await runner.tmux.capturePane(pane)).includes("Думаю."));
let prev = "";
await waitFor("screen settled", async () => {
const now = await runner.tmux.capturePane(pane);
const same = now === prev;
prev = now;
if (!same) await new Promise((r) => setTimeout(r, 700));
return same;
});
const t0 = Date.now();
await tickAt(new Date(t0)); // remembers the screen
await tickAt(new Date(t0 + 10 * MIN), 5 * MIN); // stalled → alert