Skip to content

test: let session C release session A instead of a 3 s timer - #283

Merged
devsuitup merged 1 commit into
mainfrom
test/173-serialization-state-based
Sep 13, 2026
Merged

devsuitup merged 1 commit into
mainfrom
test/173-serialization-state-based

Conversation

@devsuitup

Copy link
Copy Markdown
Owner

Part of #173 (the suite depends on the real clock). This is the one timing test that went red on CI three times this week (test (20, windows-2022), #279 and earlier), always green on rerun.

Why

session serialization: two triggers on different sessions still run in parallel unblocked session A with setTimeout(3000) and asserted that C had written before that fired. On a slow runner C's dispatch could land after 3 s: the assertion measured the host, not the watcher.

What

C's own \r write releases A. The ordering is now a state transition: if the watcher serialized C behind A, A would hit its idle timeout (3 s) and resultA.ok would be false, with a message saying so. The two waitForFile waits become ceilings (scaleUp(10000)), not measurements. The test now takes ~120 ms instead of 3 s.

Proof

  • Mutation: C no longer releasing A → the test fails at 3.05 s on resultA.ok with the new message; reverted.
  • Both serialization tests green in isolation; task check green (hook).

The cross-session parallelism test unblocked A on a wall-clock timer and
asserted C had written before it fired; on a slow CI runner the dispatch of
C could land after the timer and the test went red (three times this week,
issue #173). C's own write now releases A, so the ordering is a state
transition: if C were serialized behind A, A would hit its idle timeout and
resultA.ok would be false. Both waits become ceilings, and a mutation that
stops C from releasing A makes the test fail as intended.
@devsuitup
devsuitup merged commit 7ae729e into main Sep 13, 2026
10 checks passed
@devsuitup
devsuitup deleted the test/173-serialization-state-based branch September 13, 2026 09:44
@devsuitup devsuitup mentioned this pull request Sep 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant