PEP-273: тест зависшего раннера ждёт, пока экран успокоится (нестабилен в CI)
All checks were successful
peppa/lint lint: success за 2с
peppa/typecheck typecheck: success за 53с
peppa/build build: success за 35с
peppa/test test: success за 1590с
peppa-ci / ci (pull_request) Successful in 28m43s

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

View File

@ -131,7 +131,17 @@ describe("Зависший раннер перезапускается", () => {
await p.waitLog("turn 0", (e) => e.ev === "prompt");
await new Promise((r) => setTimeout(r, 1500));
const t0 = Date.now();
await tickAt(new Date(t0)); // remembers the screen
// Remember the screen once it has settled: on a busy machine the agent may still be drawing
// after a fixed pause, and a change seen by the next tick counts as activity (flaky in CI).
let seen: string | undefined;
await waitFor("screen settled", async () => {
await tickAt(new Date(t0));
const now = (await sess(sid)).watchState?.screen;
const same = !!now && now === seen;
seen = now;
if (!same) await new Promise((r) => setTimeout(r, 300));
return same;
});
await tickAt(new Date(t0 + 10 * MIN), 5 * MIN); // stalled → alert
const s = await sess(sid);
assert.equal(s.status, "stalled");