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: daemon-client explicit-lifecycle tests time out near the 5 s limit and cascade #4848
Three tests in packages/daemon-client/src/__tests__/daemon-client-ensure-explicit-lifecycle.test.ts failed together in the Coverage job of #4839, a PR that does not touch daemon-client. A rerun with no code change passed. The file can fail any PR.
ensureDaemon reports contention when the daemon keeps changing under it: timed out at 5000 ms (5.07 s).
ensureDaemon does not start a daemon over one it could not confirm retired: spawn.mock.calls.length was 2, expected 0.
a quiesce the daemon never hears is judged again, not reported as a transport failure: timed out at 5000 ms (5.08 s).
The other 21,796 tests passed. On a loaded development host the same two timing tests ran 2.7 s and 4.1 s against a 2.5 s budget.
Likely cause (not proven)
The two timing tests wait real time close to the 5 s test timeout.
The assertion failure looks like a cascade: spawn is a module-level mock, and afterEach resets it while the ensureDaemon call of the test that timed out is still running. That call can then record spawns in the next test.
Required behavior
The two timing tests do not wait real time: the retry and poll budget is injected or asserted, as docs/agents/testing.md requires.
A test that times out cannot change the result of the next test. Its ensureDaemon call is finished or cancelled before the shared spawn mock is reset.
Completion conditions
Both tests run under the 2.5 s slow-test budget on CI.
The file passes 20 repeated runs on a loaded host.
A forced timeout in one test does not fail the test after it.
The issue reports concrete flaky test failures in daemon-client explicit-lifecycle tests with named test names, CI run evidence, timing values, and a cascading mock-reset mechanism, indicating existing test/CI behavior is broken.
Activity
apex-sentinel-staging commentedon Nov 20, 2026
Apex Sentinel · Issue review
Suggested label:
bugThe issue reports concrete flaky test failures in daemon-client explicit-lifecycle tests with named test names, CI run evidence, timing values, and a cascading mock-reset mechanism, indicating existing test/CI behavior is broken.
Required sections