Repository navigation
test: poll instead of fixed sleeps for debounced persist writes (Windows CI flake) - #559
Merged
Merged
Conversation
CI Windows runners intermittently sweep %TEMP% mid-test: the debounced persist write hits a transient ENOENT on rename (tmp file or dir gone). acp-kernel (PR 201) now retries the whole write cycle on transient ENOENT/ENOTDIR, which can land the write well past the 5ms debounce — so tests must poll with a deadline instead of asserting right after a fixed settle()/sleep. - proxy-persist.test.ts: waitFor() helper; debounce test polls loadSync (deadline 5s, covers the kernel retry ladder ~1.5s with headroom). - e2e-export-handoff.test.ts: poll listSessions until the session shows the compression block (deadline 10s). Polling on length alone raced the first pre-compression snapshot and failed 'blocks >= 1'. Fixes the recurring windows-22 flakes: - proxy-persist.test.ts:109 'Cannot read properties of null' - e2e-export-handoff.test.ts:174 'expected 1 persisted session, got 0'
Contributor
📦 Built Package ArtifactBranch: Option A — Install from npm PR tag (recommended)npm install -g billion-context@pr-559Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf billion-context-pr559.tgz
npm install -g packageThis comment is automatically updated on each push. |
This was referenced Sep 5, 2026
Merged
ranxianglei
added a commit
that referenced
this pull request
Sep 5, 2026
- CONFIGURATION.md: keep both the EPERM alert knobs and master's BILI_TUNNEL_ALLOWED_HOSTS row. - tests/proxy-persist.test.ts: keep master's #499 pfa migration test and the PR's wire test; the wire test now polls (waitFor, 5s) for the kernel failure line because acp-kernel 0.0.53 retries the whole write cycle on transient ENOTDIR (~1.5s) before logging it — a fixed settle(50) would fail. Verified against pinned acp-kernel 0.0.53: recordFailure emits the same '[persist] write failed for <id> (total <N>x): <err>' shape the detector regex parses; EPERM/EBUSY/EACCES lock codes remain non-transient enough to count toward the alert. Pre-flight: typecheck ✓, tests 1058/1060 (2 known env fails in plugin-agent.test.ts), build ✓.
ranxianglei
added a commit
that referenced
this pull request
Sep 5, 2026
- CONFIGURATION.md: keep both the EPERM alert knobs and master's BILI_TUNNEL_ALLOWED_HOSTS row. - tests/proxy-persist.test.ts: keep master's #499 pfa migration test and the PR's wire test; the wire test now polls (waitFor, 5s) for the kernel failure line because acp-kernel 0.0.53 retries the whole write cycle on transient ENOTDIR (~1.5s) before logging it — a fixed settle(50) would fail. Verified against pinned acp-kernel 0.0.53: recordFailure emits the same '[persist] write failed for <id> (total <N>x): <err>' shape the detector regex parses; EPERM/EBUSY/EACCES lock codes remain non-transient enough to count toward the alert. Pre-flight: typecheck ✓, tests 1058/1060 (2 known env fails in plugin-agent.test.ts), build ✓.
antclt
pushed a commit
to antclt/billion-context
that referenced
this pull request
Sep 5, 2026
Consumes acp-kernel v0.0.53 (PR ranxianglei#201): the whole write cycle (mkdir + fresh tmp + write + rename) is retried on transient ENOENT/ENOTDIR — Windows %TEMP% sweeps / AV no longer drop session persists — and the spill write retries too. Test-side polling shipped in PR ranxianglei#559.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixes the recurring windows-22 CI flake seen on recent PRs (#540/#535/#539/#337…), where two tests intermittently fail:
tests/proxy-persist.test.ts:109—scheduleSave debounces and eventually writes→Cannot read properties of null (reading 'stats')tests/e2e-export-handoff.test.ts:174—expected 1 persisted session, got 0Both failures share the same upstream signature:
Root cause (two layers, this PR is layer 2)
%TEMP%, deleting freshly-created files/dirs betweenwriteFile(tmp)andrename. The kernel's old retry set (EPERM/EBUSY/EACCES) rethrewENOENTimmediately. release v0.1.46 #201 retries the whole write cycle (mkdir + fresh tmp + write + rename) on transientENOENT/ENOTDIRand retries the spill too.settle(30ms)/setTimeout(100)assert would still flake even though the data is safe. Polling makes the tests observe the eventual write instead of racing it.Changes
tests/proxy-persist.test.ts: newwaitFor()poll helper; the debounce test now pollsloadSync()with a 5s deadline (covers the kernel retry ladder with headroom).tests/e2e-export-handoff.test.ts: polllistSessions()until the persisted session shows the compression block (blocks >= 1), deadline 10s. Note: polling onlengthalone raced the first pre-compression snapshot and failedblocks >= 1— the poll condition must match the assertion.No production code touched.
Pre-flight
npm run typecheck✓npm test1046/1048 (2 known env-dependent fails inplugin-agent.test.ts, unrelated)npm run build✓Follow-up
Once acp-kernel v0.0.53 is live on npm, a separate change will bump the
acp-kernelpin here so the retry fix ships in the next bili release.