Repository navigation
Closed
Labels
agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.Context and acceptance criteria are complete enough for an agent to take this unattended.area: ui-serverHono app factory: turn coordinator, auth, session catalog, routes, cron.Hono app factory: turn coordinator, auth, session catalog, routes, cron.priority: p3Someday. Needs a driving use case before it starts.Someday. Needs a driving use case before it starts.type: testCoverage, harness or proof work with no behaviour change.Coverage, harness or proof work with no behaviour change.
Milestone
Description
What happens
Some tests prove that a directory was created or removed by listing the shared temp directory, readdirSync(tmpdir()), and filtering it by a name prefix. Concurrent test processes create directories with the same prefixes there. So a diff can see another process's directory, or an exact count can include it.
That is how main run 44219495479 failed autonomous-envelope.test.ts "finishing the turn stops its relay" (expected 1 new relay directory, received 2). Its fix is the declared fix for #4250: that file gets a private TMPDIR. The same pattern remains in:
packages/ui-server/tests/turn-data-tree-placement.test.ts:70:tmpTreesdiffsbrain-turn-data-*before and after.packages/ui-server/tests/turn-data-tree.test.ts:454:bases()countsbrain-private-index-base-*and expects exactly one ("ONE_BASE_SEALED").packages/ui-server/tests/turn-data-tree.test.ts:547:left()comparesbrain-turn-data-*andbrain-private-index-*before and after ("AN_ABORTED_COPY_LEAVES_NOTHING").packages/ui-backend-claude/tests/fixtures/server-host-relay-probe.ts:199: comparesbrain-inference-*before and after a native release failure.
private-index-cache.test.ts already avoids this by filtering on process.pid.
Acceptance criteria
- Each listed test counts only directories its own process created: a private
TMPDIRfor the file or the probe, a pid-scoped name, or the path the code under test returns. - A contention receipt for each: with a loop creating matching directories in the shared temp directory, the test fails before the change and passes after.
- No other test under
packages/*/testsortests/diffs or counts the shared temp directory by a prefix that is not process-scoped.
Metadata
Metadata
Assignees
Labels
agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.Context and acceptance criteria are complete enough for an agent to take this unattended.area: ui-serverHono app factory: turn coordinator, auth, session catalog, routes, cron.Hono app factory: turn coordinator, auth, session catalog, routes, cron.priority: p3Someday. Needs a driving use case before it starts.Someday. Needs a driving use case before it starts.type: testCoverage, harness or proof work with no behaviour change.Coverage, harness or proof work with no behaviour change.
Activity
schlessera commentedon Nov 18, 2026
Claimed for implementation. Claim token:
claim-38a36a5d. Branch:test/4247-4249-4252-test-races.Worked together with #4247, #4249 and #4252 in one test-only PR. Collisions: closure-level only with long-lived drafts, no path collision.
test(ui-server): close three test races: partial JSON lines, a slow c…
schlessera commentedon Nov 18, 2026
Delivered in #4254 (squash bd751d4 on main).
turn-data-tree-placement.test.tsnow lists its trees in a privateTMPDIR(usePrivateTmpdir, which asserts the directory being listed). Contention receipt: with a loop creating matching directories in /tmp, main failed 3 of 3 runs onNO_TEMPORARY_COPYand the branch passed 3 of 3.turn-data-tree.test.ts(bases(),left()) was already isolated: itsfixture(packages/ui-server/tests/turn-data-tree.test.ts:60-63) gives each test its ownTMPDIR. Both cases passed 3 of 3 runs on main under the same loop, so the file is unchanged.server-host-relay-probe.tsonly runs under bwrap with--tmpfs /tmp, or one step at a time inside adocker run --rmcontainer, so its temp directory is private by construction. A comment now records that.packages/*/testsortests/lists the shared temp directory by a prefix that is not process-scoped.