You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
flaky: slow-android-stream still-screen key frames stay fewer than 4 after the first 15 s on a slow-lane emulator #1762
e2e/slow-android-stream.test.ts, "streams a leased emulator's screen as meta, an avcC description and an H.264 key frame, … keeps a still screen open 15 s past the silence bound with a key frame at least every 5.5 s, …" fails in the slow lane with AssertionError: fewer than 4 key frames after the first 15 s of a still screen.
On 2026-11-19, on one macOS slow-lane machine, two runs in a row:
main's src/drivers/android/screen/session.ts (fb42676): expected 2 to be greater than or equal to 4.
The test already leaves out the first 15 s because a just-booted emulator answers its first resets in 2 to 5 s. In these runs, the 30 s after that still did not settle to about one key frame per reset. It matches the screen module manual's known gap ("A fresh emulator answers its first resets slowly"), lasting longer than the test allows. Whether ADR 0079 §5's 5 s bound is missed on this emulator, or only the test's settle window is too short, is not measured yet.
src/drivers/android/screen/session-body-and-close.test.ts, "relays a still screen's key frame 4 s plus the answer after the last one when the device takes 5 s to answer reset video" (bug/1762-repro). Its fake device acts as scrcpy v5.0.1 does: a reset that comes during an answer restarts it.
pnpm exec vitest run --project unit src/drivers/android/screen/session-body-and-close.test.ts -t "takes 5 s to answer"
AssertionError: key frames, in ms after the open, of a still screen: expected [] to deeply equal [ 9000, 18000 ]
Independent answers under 4 s would give at least 3 key frames in 30 s; the lane saw 1 and 2.
Root cause
Defect. src/drivers/android/screen/session.ts:379: the reset timer re-arms itself, so a still screen gets reset video every 4 s, answered or not. scrcpy answers by building a new capture and encoder, and when another reset came meanwhile it sends nothing and builds again (SurfaceEncoder.java:142 at v5.0.1, if (!captureControl.isResetRequested())). On an emulator that answers in over 4 s (the e2e's comment measured 2 to 5 s after boot), our next reset cancels each answer, so key frames stop until one fits between two resets. The manual's known gap (slow first resets) is the trigger, not the cause.
Simplest fix
The callback writes the reset without re-arming (this.#resetTimer = undefined for this.#armReset()); the next key frame arms it. The existing 4 s reset test's second reset at 8 s becomes none. Update session.ts:52-54 and the screen manual.
pnpm exec vitest run --project unit src/drivers/android/
Tests 741 passed | 1 skipped (742)
Alternatives rejected
Retry unanswered resets after 10 s: cancels slower answers too; scrcpy never drops a reset.
Widen the e2e's settle window: hides it; joiners still wait.
Raise RESET_VIDEO_AFTER_MS: breaks ADR 0079 §5.
Risk
Slow lane not run. Gaps become 4 s plus the answer, so the e2e's 5.5 s check still fails while answers exceed 1.5 s. The fix PR needs a slow-lane line for e2e/slow-android-stream.test.ts.
A server that never answers gets one reset, not one per 4 s; alive frames keep it open, as today.
Maintainer decision on the triage report (2026-11-24):
Approved as proposed: the reset timer no longer re-arms itself; the next key frame arms it.
The maintainer approves a slow-lane run for this fix: the fix PR carries a Hardware Done when line for e2e/slow-android-stream.test.ts. If its 5.5 s key-frame check still fails because the emulator answers slowly, stop and ask the maintainer before changing the e2e's bound.
Activity
fix(android-screen): an Android stream's scrcpy command line stays un…
V3RON commentedon Nov 24, 2026
Reproduction
src/drivers/android/screen/session-body-and-close.test.ts, "relays a still screen's key frame 4 s plus the answer after the last one when the device takes 5 s to answer reset video" (bug/1762-repro). Its fake device acts as scrcpy v5.0.1 does: a reset that comes during an answer restarts it.Independent answers under 4 s would give at least 3 key frames in 30 s; the lane saw 1 and 2.
Root cause
Defect.
src/drivers/android/screen/session.ts:379: the reset timer re-arms itself, so a still screen gets reset video every 4 s, answered or not. scrcpy answers by building a new capture and encoder, and when another reset came meanwhile it sends nothing and builds again (SurfaceEncoder.java:142at v5.0.1,if (!captureControl.isResetRequested())). On an emulator that answers in over 4 s (the e2e's comment measured 2 to 5 s after boot), our next reset cancels each answer, so key frames stop until one fits between two resets. The manual's known gap (slow first resets) is the trigger, not the cause.Simplest fix
The callback writes the reset without re-arming (
this.#resetTimer = undefinedforthis.#armReset()); the next key frame arms it. The existing 4 s reset test's second reset at 8 s becomes none. Updatesession.ts:52-54and the screen manual.Alternatives rejected
RESET_VIDEO_AFTER_MS: breaks ADR 0079 §5.Risk
e2e/slow-android-stream.test.ts.aliveframes keep it open, as today.Fast track
Written by an agent.
V3RON commentedon Nov 24, 2026
Maintainer decision on the triage report (2026-11-24):
Approved as proposed: the reset timer no longer re-arms itself; the next key frame arms it.
The maintainer approves a slow-lane run for this fix: the fix PR carries a Hardware Done when line for
e2e/slow-android-stream.test.ts. If its 5.5 s key-frame check still fails because the emulator answers slowly, stop and ask the maintainer before changing the e2e's bound.Written by an agent.
fix(android): the still screen's reset video waits 3 s so a slow answ…
docs(adr): a still Android screen resets every 3 s, not 4 s (#1762)
V3RON commentedon Nov 24, 2026
Delivery run
Merged: #1828 (#1762)
Parked: none
Waiting: none
Decided: #1762 — 5.5 s key-frame check failed at a 4 s reset → reset wait 3 s (maintainer, option 1)
Written by an agent.
fix(android): a still screen's reset video waits for its key frame (c…
chore(agents): a slow-lane failure is sorted before any fix run, and …