Repository navigation
Commit a6ee24f
fix(windows): writable fsync handles, hermetic ACL test lanes, teardown codemod (#3258)
* fix(windows): fsync token and spill files through a writable handle; bump test spawns a real path
Windows rejects fsync on a read-only fd with EPERM. service-secrets opened
'r' for every backup/replace/restore, so all three token-ownership cases and
the connected-key-rotation child failed on windows-latest; spill-store did the
same on its exclusive-copy fallback. Both now open 'r+' (asserted via an
openSync spy, driven red).
tests/bump-dev-version used new URL(...).pathname, which is '/D:/a/...' on
Windows, so bun could not load the CLI and every case exited 1 — including the
malformed-input case, which read that as a correct rejection. fileURLToPath +
process.execPath, stderr in the failure message, and the specific rejection
text asserted.
* test(responses-state): hermetic platform lanes; release the ACL gate in finally
Generic spill/admission cases assert the synchronous lane, so they pin the
platform to linux; a Windows host routed them through queued async publication
and they read a resident where a stub was expected (~45 cases). Windows-lane
cases now inject both principal resolvers alongside the platform: on the
hosted runner the real PowerShell lookup failed with EACLIDENTITY before the
case reached its own seams. That failure happened outside the try/finally in
'prices the job-owned superseded generation', so the held icacls promise was
never released and the next case waited for it until Bun's 60 s ceiling.
spill-store.harden() now consults windowsSecretAclApplies() on both lanes so
the platform seam reaches the sync harden too.
* test(windows): stub icacls in service.test, settle async spills in issue-702, size the first child wait
Dispatch 33595585136 (first run with the ACL lifecycle fix): windows 1/4 fell
from ~120 failures to 8 and the account-store/auth-api cascades are gone.
What remained: service.test.ts hands a synthetic SID to a REAL icacls on a
Windows host (EICACLS on every saveConfig) — both runners are now stubbed at
file scope; issue-702 unlinked a spill that Windows had not yet published —
it awaits the publication first; native-profile-manager's crash case waited a
private 5 s for the first child boot of the shard — it now waits inside its
own 15 s budget and reports the child's stderr on timeout.
* test(responses-state): gate only spill hardens; copy fallback follows the platform seam
Dispatch 33595585136 shard 2 left two failures in this file. The shutdown
budget case gated EVERY async icacls call, and on a real Windows host the
snapshot flush hardens responses-state.json through the same runner, so
flushResponseState() sat behind the gate until the 30 s ACL deadline and the
case hit Bun's 60 s ceiling. Gated runners now pass non-spill targets through.
canUseExclusiveCopyFallback keyed on process.platform, so a case pinned to the
POSIX lane on Windows turned an injected link failure into a successful copy
and asserted a tombstone that never came; it now uses the same seam as harden().
* test(responses-state): win32 admission variants; assert the propagated shutdown rejection
Reviewer P2: pinning the admission suite to the sync lane left the Windows
async branch (runPendingResponseSpill post-write ceiling, failure tombstone)
without a case. Two win32 variants now cover it after the queue settles; the
write-failure variant scopes the injected failure to the oversized candidate
because the queued candidate counts against the RAM cap while it waits.
P3: the rejected-release regression now asserts the original error message.
* devlog(windows): 011 — dispatch rounds, reviewer verdicts, fuck-powershell cases
* test(native-main-refresh): yield to the event loop while waiting for the abort listener
The wait spun on Promise.resolve(), which keeps the microtask queue non-empty
and never lets a subprocess exit callback run. On Windows the exclusive claim
can harden its lock file through an async icacls child before it reaches the
abort listener, so the spin never ends. Dispatch 33597649234 shard 4 sat in
this file for eight minutes until the job ceiling with zero failures logged.
* test(server-stop): replace the 60 ms pending oracle with an observed listener close
Reviewer P3: the shutdown-drain regression assumed all earlier stop() stages
finished within 60 ms. It now polls until the listener refuses connections,
so 'still pending' can only mean the held ACL flight.
* test(windows): yield in the remaining claim-cancellation waits; retrying teardown in oauth-manual-code and provider-quota
Dispatch 33601508392 shard 4 hung again in responses-native-main-refresh —
the two WebSocket string-abort cases spun on Promise.resolve() like the one
fixed in 2bf189d. Both now yield to the event loop. Two more bare rmSync
teardowns (oauth-manual-code fixed dir, provider-quota temp homes) go through
removeTreeWithRetry.
* test(windows): freeze the spill ACL clocks in the shutdown-fallback cases; let the write-lock holder outlast a slow contender boot
Now that harden() follows the platform seam, the synchronous fallback harden
really runs on every host, and its 80 ms reserve raced a loaded Linux shard's
wall clock (run 33603770447 test 3/4). The three fallback cases inject the
same frozen clock the budget case already used.
codex-write-lock's holder used the helper's default 3 s ceiling; a windows-
latest contender took longer than that to boot, so the hold expired first and
the contender read 'acquired'. The ceiling is now 20 s — the release marker
still ends the hold immediately.
* test(oauth-manual-code): per-test scratch home with both icacls runners stubbed
The manual-code login test persisted its credential through the real icacls
on windows-latest and settled as 'OAuth authentication failed' (run
33603770447 shard 4). Same shape as codex-account-store / codex-auth-api:
this file is about the PKCE flow, not ACLs.
* test(retained-root): size the child marker wait inside the test budget
A bun --eval child reaches its marker in 8-11 s on windows-latest; the 10 s
default wait lost the race on run 33605898170 shard 1 while the same case
passed at 10.4-10.6 s on earlier runs.
* test(windows): route every recursive scratch-tree removal through removeTreeWithRetry
Mechanical codemod (script kept in .tmp): 870 rmSync(recursive) teardown sites
across 381 test files now use the bounded EPERM/EBUSY/ENOTEMPTY retry. Each
Windows dispatch so far surfaced one or two more bare rmSync sites (oauth-
reauth-bind, responses-native-main-refresh, provider-quota, ...); this closes
the class instead of chasing it a shard at a time. 18 sites in 8 files skipped
on purpose: mixed file/dir collections, existing custom retry helpers, and the
ACL fixture whose shape covers single files. tsc green; test:changed 14165
pass / 2 lab-fabric cases that pass in isolation.
* test: fail the listener-close poll closed; per-call marker deadlines inside each test budget
Reviewer P2s: the shutdown-drain oracle fell through after 200 attempts without
asserting the listener was closed, so a still-open listener could pass as
'pending on the ACL flight'; it now asserts refused. retained-root's 16 s
default exceeded the 15 s budget of its first caller, so Bun's timeout, not the
helper, would report a slow child; every caller now passes an explicit
deadline that fits its own budget.
* test(windows): stub icacls in oauth-reauth-bind; widen the startup child port wait
Dispatch 33610501053 shard 4: oauth-reauth-bind has no server, so nothing
drained the OAuth store's ACL flight before teardown and the icacls child
outlived the retry window; both runners are stubbed and the flight flushed.
native-profile-startup's child needed 17 s to reach its port file on the
loaded shard; the wait is now 18 s inside 20 s+ budgets.
* test(oauth-public-surface): stub icacls and flush the ACL flight in a server-less OAuth store test
---------
Co-authored-by: jun <[email protected]>1 parent 19b0157 commit a6ee24f
388 files changed
Lines changed: 1956 additions & 1294 deletions
File tree
- devlog/_plan/260902_windows_ci_release
- src
- lib
- responses
- tests
- helpers
- images
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
70 | 72 | | |
71 | 73 | | |
72 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
218 | | - | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
219 | 221 | | |
220 | 222 | | |
221 | 223 | | |
| |||
235 | 237 | | |
236 | 238 | | |
237 | 239 | | |
238 | | - | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
239 | 243 | | |
240 | 244 | | |
241 | 245 | | |
| |||
384 | 388 | | |
385 | 389 | | |
386 | 390 | | |
387 | | - | |
| 391 | + | |
| 392 | + | |
388 | 393 | | |
389 | 394 | | |
390 | 395 | | |
| |||
422 | 427 | | |
423 | 428 | | |
424 | 429 | | |
425 | | - | |
| 430 | + | |
426 | 431 | | |
427 | 432 | | |
428 | 433 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | | - | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
454 | 454 | | |
455 | 455 | | |
456 | 456 | | |
457 | | - | |
| 457 | + | |
458 | 458 | | |
459 | 459 | | |
460 | 460 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
57 | | - | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| |||
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
89 | | - | |
| 90 | + | |
90 | 91 | | |
91 | 92 | | |
92 | 93 | | |
| |||
138 | 139 | | |
139 | 140 | | |
140 | 141 | | |
141 | | - | |
| 142 | + | |
142 | 143 | | |
143 | 144 | | |
144 | 145 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
94 | 95 | | |
95 | 96 | | |
96 | 97 | | |
97 | | - | |
| 98 | + | |
98 | 99 | | |
99 | 100 | | |
100 | 101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
63 | | - | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | | - | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
27 | | - | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
43 | | - | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
59 | | - | |
| 60 | + | |
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
| |||
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
77 | | - | |
| 78 | + | |
78 | 79 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
73 | | - | |
| 74 | + | |
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
| |||
142 | 143 | | |
143 | 144 | | |
144 | 145 | | |
145 | | - | |
| 146 | + | |
146 | 147 | | |
147 | 148 | | |
148 | 149 | | |
| |||
0 commit comments