Skip to content

test: drain quota publications before the failed-storage fixture swap - #415

Merged
ualtinok merged 1 commit into
mainfrom
test/quota-reload-drain
Oct 20, 2026
Merged

ualtinok merged 1 commit into
mainfrom
test/quota-reload-drain

Conversation

@antauth-alfonso

@antauth-alfonso antauth-alfonso Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

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 EEXIST when in-flight quota publications recreated the pool config file between the test helper's rm and mkdir.

  • Waits for the plugin's startup work and drains pending quota publications before swapping the config file for a directory, mirroring the existing sidebar-write drain.
  • Test-only; no assertions, deadlines, or production code changed.

Written for commit 5933b18. Summary will update on new commits.

View guided diff Turn on auto-fix

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.
@ualtinok
ualtinok merged commit 5933b18 into main Oct 20, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant