test(interactive): poll the foreground-shell frame instead of snapshotting it (#16455)

#15712 recurred on 2026-11-05 (run 42069115052, macOS): the case asserted
`compact(frame('mode-before'))` contains `YOLO mode` straight after a PTY
write, and on a loaded host the approval footer had not repainted yet — the
captured frame still held the startup banner, so the assertion failed on a
correct UI. The draft snapshot just above it has the same shape.

Poll both through the suite's `until`, which already scales its budget 3x
under CI (#16276), so a slow repaint is waited out while a genuinely missing
footer still fails on the same message, with the frame kept in FRAMES.json.

Verified locally: the case passes (16.9s) and the whole file passes
(3 passed, 1 skipped).
This commit is contained in:
易良 authored and GitHub committed 2026-11-06 20:28:34 +08:00
1 parent 1853b1505f
commit 1ecf444010
1 file changed
+15 -2
@@ -531,7 +531,14 @@ shellTest(
c.stage('COMPOSER_DRAFT');
await c.key('\x06');
await c.type('DRAFT_OWNED');
expect(compact(await c.frame('draft-held'))).toContain('DRAFT_OWNED');
// The frame is a snapshot, not a wait: on a loaded host the draft can
// still be one repaint behind when it is captured (nightly run
// 42069115052 failed the same way on the footer below).
await until(
async () =>
compact(await c.frame('draft-held')).includes('DRAFT_OWNED'),
'Composer draft did not render in the frame',
);
expect(c.bytes()).toBe(firstInput);
expect(c.server.requests).toHaveLength(1);
c.stage('PTY_FOCUS_RETURN');
@@ -543,7 +550,13 @@ shellTest(
);
expect(c.bytes()).toBe(resumedInput);
c.stage('FOCUSED_APPROVAL_MODE');
expect(compact(await c.frame('mode-before'))).toContain('YOLOmode');
// Same hazard as the draft: the approval footer is a later repaint than
// the PTY write this test just awaited, so poll for it instead of
// asserting on one snapshot (#15712, run 42069115052).
await until(
async () => compact(await c.frame('mode-before')).includes('YOLOmode'),
'Focused approval footer did not show YOLO mode',
);
await c.key('\x1b[Z');
await until(
async () =>