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: console Screen tab test times out waiting for capture close #1219
e2e/console/screen.spec.ts:180 "the device drawer's Screen tab › opens on Details with no capture, starts one and paints it on Screen, closes it on Details or closing the drawer, and keeps it when the device is leased" failed once in CI run 41510787354 (PR #1210, commit d4e958e, Console 2/4).
Error: logReached(dir, "closed", 1) at screen.spec.ts:251 timed out: the daemon did not log "closed" within 10 s of the Details click.
It passed 4 of 4 runs locally (Chromium, --repeat-each=3 --workers=3) and passed in CI on the next head (dedb9f8). The Details-click and capture-close part of the test is unchanged from the merge-base.
This is a defect in the test's capture stand-in, not in the daemon. The capture does stop, but the stand-in does not log "closed" when its stdout reader goes away before its stdin ends.
e2e/console/screen-capture.test.ts on bug/1219-repro, "the console lane's capture program › logs closed when its stdin ends and when its reader goes away before its stdin ends":
e2e/console/screen-capture.ts:62: process.stdout.on("error", () => process.exit(0)) exits without writing closed. Only the stdin end handler (line 56) writes it. When a viewer leaves, two things race to stop the capture. One is the abort listener (src/stream/worker-link.ts:66, which ends stdin). The other is the body's cancel (src/stream/feed.ts:103-105), which destroys the child's stdout before feed.close() ends stdin. If the stand-in's 100 ms write timer fires in that gap, it gets EPIPE and exits silently. logReached(dir, "closed", 1) then waits out its 10 s. The real capture program treats EPIPE as a normal stop (vendor/screen-capture/Sources/SimlockCapture/Options.swift:137), so the daemon's order is fine. The lane's witness only misses this kind of stop.
Simplest fix
In the program writeCaptureProgram writes, make the stdout error handler appendFileSync(LOG, "closed\n") before process.exit(0). I tried this locally: the reproduction passes.
Alternatives rejected
Close stdin before cancelling stdout in followedBy: the abort listener and the body cancel still race, and the child can still write first.
Raise logReached's timeout: the stand-in never logs, so no wait is long enough.
Risk
After the fix, a capture that dies on EPIPE for some other reason also counts as closed. That is acceptable, because the real tool ends the same way.
The CI run kept no trace, so this cause is inferred from code and the reproduction, not read from that run's log.
Maintainer decision (relayed by an agent): fix as the triage report proposes. The test's stand-in capture program (e2e/console/screen-capture.ts:62) writes "closed" before it exits on a failed stdout write, so both ways Simlock stops a capture log it. Simlock's own stop order stays as it is. The reproduction is on bug/1219-repro.
Activity
V3RON commentedon Nov 3, 2026
Reproduction
This is a defect in the test's capture stand-in, not in the daemon. The capture does stop, but the stand-in does not log "closed" when its stdout reader goes away before its stdin ends.
e2e/console/screen-capture.test.tsonbug/1219-repro, "the console lane's capture program › logs closed when its stdin ends and when its reader goes away before its stdin ends":Root cause
e2e/console/screen-capture.ts:62:process.stdout.on("error", () => process.exit(0))exits without writingclosed. Only the stdinendhandler (line 56) writes it. When a viewer leaves, two things race to stop the capture. One is the abort listener (src/stream/worker-link.ts:66, which ends stdin). The other is the body's cancel (src/stream/feed.ts:103-105), which destroys the child's stdout beforefeed.close()ends stdin. If the stand-in's 100 ms write timer fires in that gap, it gets EPIPE and exits silently.logReached(dir, "closed", 1)then waits out its 10 s. The real capture program treats EPIPE as a normal stop (vendor/screen-capture/Sources/SimlockCapture/Options.swift:137), so the daemon's order is fine. The lane's witness only misses this kind of stop.Simplest fix
In the program
writeCaptureProgramwrites, make the stdout error handlerappendFileSync(LOG, "closed\n")beforeprocess.exit(0). I tried this locally: the reproduction passes.Alternatives rejected
followedBy: the abort listener and the body cancel still race, and the child can still write first.logReached's timeout: the stand-in never logs, so no wait is long enough.Risk
closed. That is acceptable, because the real tool ends the same way.Written by an agent.
V3RON commentedon Nov 3, 2026
Maintainer decision (relayed by an agent): fix as the triage report proposes. The test's stand-in capture program (
e2e/console/screen-capture.ts:62) writes "closed" before it exits on a failed stdout write, so both ways Simlock stops a capture log it. Simlock's own stop order stays as it is. The reproduction is onbug/1219-repro.Written by an agent.
V3RON commentedon Nov 3, 2026
Delivery run
Merged: #1230 (#1219)
Written by an agent.
fix(e2e): capture stand-in logs closed when its stdout fails (callsta…