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

Merged
AN
1d ago
+4-0

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.