test(server): make Windows path and async fixtures deterministic - #9576
Conversation
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: unavailable · PR result: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
4262108 to
e5cd793
Compare
e8bf6ff to
1c663fb
Compare
1c663fb to
74ad05b
Compare
ab8d9fe to
91ee36b
Compare
419699d to
d9d9d0b
Compare
d9d9d0b to
d0aff95
Compare
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — All changes are confined to existing test files and improve Windows path, file-descriptor, filesystem-race, and unsupported-FIFO handling. No production behavior, product defaults, static-analysis configuration, or customer request path is changed. Notes:
No code changes detected at You can add or adjust custom eligibility rules. Learn more. |
d0aff95 to
edff38e
Compare
Dismissing prior approval to re-evaluate edff38e
edff38e to
678154a
Compare
678154a to
101a360
Compare
101a360 to
84fdeb5
Compare
… with ProviderInstanceRegistryLive, AntigravityAdapter, and SourceControlRepositoryService asserted literal posix paths against values the code under test had run through Path.resolve or Path.join, so on Windows the received side carried a drive letter and backslashes. Resolve the expectation with the same Path. cli/config tolerates the bootstrap fd already being closed where the reader has no /proc path and consumes the fd itself, and WorkspaceFileSystem skips its FIFO case on Windows. Co-Authored-By: Claude Code <noreply@anthropic.com>
…on the cache file Two ProviderRegistry tests polled the status-cache file up to 50 times after publishing a change, which lost the race on a loaded Windows runner and read the previous snapshot. The registry writes the cache and only then publishes, so subscribe to its change stream before publishing and join on the matching checkedAt; the file is on disk by then. On Windows, readBootstrapEnvelope consumes the inherited descriptor through an auto-closing stream. The successful-read tests now leave that descriptor to the stream instead of racing it with a scoped second close; failure-path tests still close descriptors they retain. Co-Authored-By: Claude Code <noreply@anthropic.com>
84fdeb5 to
3bcea0a
Compare
Several server tests compared POSIX literals with values resolved by the host Path service. Two ProviderRegistry cases also polled the cache file after publishing, racing the asynchronous persistence path on loaded runners. A static-file race fixture relied on POSIX rename-over-open behavior that Windows rejects. Finally, Windows bootstrap reads own and auto-close the inherited descriptor because there is no /proc descriptor path.
Build path expectations through the same Path service as the implementation, subscribe to the registry change stream before publishing and wait for the matching persisted update, and make bootstrap descriptor cleanup follow the reader's platform-specific ownership. On Windows, model the static replacement race with a pre-replacement snapshot handle so its metadata-and-bytes invariant remains covered. FIFO-only fixtures remain POSIX-only.
Part of the Windows test-suite stack rooted at #9564; the manual Windows lane comes from #9538.
Originally prepared with Claude Fable 5 in Claude Code; finalized with GPT-5.6 Sol in T3 Code.
Note
Make server test fixtures deterministic on Windows paths and async cleanup
closeIfOpenandopenBootstrapInputFdhelpers in bootstrap.test.ts so descriptor cleanup tolerates EBADF when the reader has already closed the fd, with Windows leaving the fd open for the reader.Pathservice instead of hard-coded separators or string concatenation.awaitPersistedProvidersubscriber that waits for the matching registry change notification.Macroscope summarized 3bcea0a.
Note
Low Risk
Test-only changes with no runtime behavior; low risk aside from possible gaps if new platforms diverge from the Path/fd assumptions encoded in the fixtures.
Overview
Hardens the server test suite for Windows and flaky CI by aligning fixtures with host path resolution and platform-specific file-descriptor behavior—no production code changes.
Bootstrap and CLI config tests add
closeIfOpen/openBootstrapInputFdso teardown tolerates fds the reader already closed on Windows (no/procreopen path). Bootstrapt3Homeexpectations usePath.resolveso absolutised homes match on drive-letter hosts.Path assertions across boot service, Antigravity adapter, provider instance registry, source control, and Claude status tests compare against
effect/Path(join/resolve) instead of POSIX literals or"/parent/child"concatenation.ProviderRegistry tests replace cache-file polling after
PubSub.publishwithawaitPersistedProvider, which subscribes tostreamChangesand waits for the matchingcheckedAtbefore reading disk—avoiding races on slow runners.Static file and workspace tests: on Windows, the atomic-replacement case opens a pre-replacement snapshot because rename-over-open fails; the FIFO rejection case is
skipIf(win32)wheremkfifodoes not exist.Reviewed by Cursor Bugbot for commit 3bcea0a. Bugbot is set up for automated code reviews on this repo. Configure here.