Repository navigation
test: drain quota publications before the failed-storage fixture swap - #415
Merged
Merged
Conversation
The explicit quota refresh returns before native quota publication finishes. recordQuota's atomic config rename can recreate the pool JSON between the helper's rm and mkdir. Join startup work and the existing scoped runtime quota-publication drain while keeping the plugin live and the sidebar read blocked. Unchanged base reproduced EEXIST in 2/200 four-way Linux invocations. The identical fixed loop had 0 EEXIST, but shared-runner RPC/deadline failures affected 27/200 invocations; the fixed serial loop had one pre-swap RPC failure in 100 invocations. A controlled held-rename probe passed both helper branches and confirmed EISDIR after the swap. Bun 1.3.14; OpenCode typecheck passed with TypeScript 7.0.2. No assertions, deadlines or production behavior changed.
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.
An OpenCode test replaced the pool config file with a directory (rm, then mkdir) so later reads fail. A detached quota publication still in flight (packages/core/src/native-account-runtime.ts:1616 -> publishLocal :1630 -> store.recordQuota :1479) could recreate the file between the two awaits and fail the test with EEXIST: 2 in 200 runs on unchanged main. That write is legitimate, account- and epoch-fenced persistence while the plugin is live, not a write after dispose. The test now waits for startup and the existing quota-publication drain before the swap. Test-only; assertions, deadlines and production code unchanged. 0 EEXIST in the same 200-run loop afterwards.
Summary by cubic
Fixes a flaky OpenCode test that failed with
EEXISTwhen in-flight quota publications recreated the pool config file between the test helper'srmandmkdir.Written for commit 5933b18. Summary will update on new commits.