Skip to content

ci: run test files with four isolated workers - #174

Merged
abogartz merged 8 commits into
abogartz:mainfrom
WhollyMindless:ci/parallel-tests
Oct 29, 2026
Merged

abogartz merged 8 commits into
abogartz:mainfrom
WhollyMindless:ci/parallel-tests

Conversation

@WhollyMindless

@WhollyMindless WhollyMindless commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Run unit and end-to-end test files with --parallel=4, using Bun's default per-file isolation while keeping cases within each file sequential. Many fixtures share environment variables and module state, so this does not enable --concurrent.

CI already runs its separate lint, Linux unit-test, Windows unit-test, and smoke jobs in parallel. This adds file-level parallelism within each test job. The local gate keeps its stages sequential and calls the same package scripts as CI, preserving failure handling and Git-environment scrubbing. Windows CI pins Bun 1.4.4 to match Linux and release jobs. Contributor documentation retains direct serial commands for test-order debugging. Required check names and the plugin's runtime engine floor are unchanged.

Two I/O-heavy scenarios receive explicit 30-second deadlines for Windows workers: the import/concurrent-writers case (30 gated imports and 80 appends, with an existing 20-second child-readiness budget), and the concurrent-reader case (300 serialized rewrites racing 400 reads). Their workload sizes and every integrity/count assertion remain unchanged. Production lock timeouts and all other test deadlines are unchanged; no test retries or skips are added.

The unresolved-session capture test waits for the complete auto_capture_refused record for its own session and trigger, instead of stopping on any auto_capture* prefix. It still requires zero stored rows and additionally requires zero model calls. A failure prints the observed evidence records. Its existing polling budget is unchanged.

The reader correction from #181 is now merged into main. After the maintainer's update to 8e91b9d, this PR's diff against main v0.14.21 is confined to seven CI, documentation, and test files. The separate remaining-reader follow-up is #184.

Validation:

  • All four hosted checks pass on 8e91b9d: lint/typecheck, Linux tests, Windows tests, and real-host end-to-end smoke.
  • The preceding head 63e2b6f passed the full local Windows/Bun 1.4.4 gate: 695 unit tests, 12 existing skips, 11 end-to-end tests, typecheck, and lint. The new merge head additionally incorporates main's fix: preserve visibility when completing duplicate updates #180 visibility fix and tests; hosted checks cover that combined tree.
  • The original capture-event failure did not reproduce locally, including 1,000 isolated repetitions. Its exact event remains unidentified because the earlier CI log omitted it; the strengthened assertion reports records if it recurs.
  • Whole-suite --rerun-each exposed separate repeat-only frontier-evidence failures even without parallel workers. Full-suite stability checks use fresh processes; that fixture-reset issue is unchanged here.

This is an optional proposal. Please feel free to reject or close it without merging if you prefer the existing test execution model or this change does not fit your plans for the project.

@abogartz abogartz left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spoke too soon. This failed the Windows test after I approved.

@WhollyMindless

Copy link
Copy Markdown
Contributor Author

@abogartz Updated in 854ca46, retaining your merge and bringing the branch up to main v0.14.19.

The failing Windows job on f26329f reports only the import/concurrent-writers scenario exceeding Bun's default 5-second test deadline; no conservation assertion failed before the timeout. That test performs 30 gated imports alongside two 40-row writers, and its internal readiness helper already permits 20 seconds. I gave only this scenario a 30-second deadline, retaining all workload sizes and row/count assertions. Production lock timeouts and other test deadlines are unchanged, and no retries were added.

Local Windows/Bun 1.4.4 validation: the full gate passes (692 unit tests, 12 skips, 11 end-to-end tests, typecheck, lint), two further fresh-process unit runs both pass, and the targeted scenario passes five repetitions. I could not reproduce the hosted five-second timeout locally, so the new hosted Windows result still needs to confirm this adjustment before merge.

The description now explicitly distinguishes existing job-level CI parallelism from the file-level parallelism this PR adds. It also records a stress-test caveat: --rerun-each exposes separate frontier-fixture reset failures even without parallel workers, so the full-suite stability runs use fresh processes.

Please re-review when the checks finish. It remains fine to decline the parallel runner approach if you prefer the existing setup.

@WhollyMindless

Copy link
Copy Markdown
Contributor Author

@abogartz The Windows check passed on 854ca46, but Linux failed the existing concurrent-reader assertion (observedPartial was 1). I found a reproducible reader defect already present on main: Bun.file().exists() caches the file size, and a larger atomic replacement before .text() can then be cropped to that old size. A standalone Bun 1.4.4 probe returned 23 bytes from a complete 10,018-byte replacement.

I opened #181 with the reader correction and a deterministic regression that fails before the source fix. This is a runtime fix, so it is separate from the optional CI proposal and can be accepted independently. The original concurrent-reader assertion remains intact; no additional deadlines or retries were introduced.

This branch includes those same commits at 906c167 for fresh CI. Please consider #181 first; after it merges, I will refresh this branch against main to leave only the CI proposal in the diff. Local Windows/Bun 1.4.4 gates pass both with #181 alone using the serial runner and here using parallel workers: 694 unit tests, 12 existing skips, 11 end-to-end tests, typecheck, and lint. Hosted Linux and Windows still need to validate the new heads.

The descriptions now explain the dependency and distinguish existing job-level CI parallelism from the file-level parallelism proposed here. Please feel free to decline either implementation if you prefer another approach.

@WhollyMindless

WhollyMindless commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor Author

@abogartz #181 passed all four hosted checks, including Windows with the serial runner. The parallel Windows run here on 906c167 failed two different test conditions. I pushed 86f2bae with two scoped test adjustments:

  • The concurrent-reader workload (300 serialized rewrites racing 400 reads) exceeded the default 5-second deadline at 5.087s. It now has a 30-second deadline, retaining every read, row-count, and no-partial-row assertion. The later 31-versus-300 error was logged after the timeout, when teardown and the next fixture could already be running; the new deadline lets the original assertions finish before that teardown. Production lock deadlines are unchanged.
  • The capture test stopped polling on any auto_capture* prefix, then asserted the specific refusal. Its hosted failure occurred after 9ms, well before its polling budget, but the log omitted the event it saw. It now waits for the full refusal record with the expected session and trigger, still requires zero stored rows, and additionally requires zero model calls. If it fails, the assertion prints the observed records. The polling budget is unchanged.

I could not reproduce either hosted failure locally: the preceding full parallel unit run passed, as did 1,000 isolated repetitions of the original capture case. I cannot identify the unexpected event from that CI log, so this is not a claim that its exact cause has been proven. Fresh hosted Windows CI still needs to validate the updated head.

Local validation of 86f2bae: all 17 focused capture-scope/concurrency tests pass; the full gate passes typecheck, lint, 694 unit tests (12 existing skips), and 11 real-host end-to-end tests. No retries or skips were added. #181 remains independently reviewable and should be considered first. Please feel free to decline the parallel execution proposal if its tradeoffs do not suit the project.

CI update: all four checks passed on 86f2bae, including Windows. The capture-refusal case passed in 18ms and the concurrent-reader case in 4.74s. The refreshed head 63e2b6f now also passes all four checks after incorporating main's README changes and #181's review nits. Its local gate passes 695 unit tests (12 existing skips) and 11 end-to-end tests. #181 is green on all four checks at fcf50b0. This remains ready for your re-review, with #181 considered first; the earlier capture event's exact identity remains unknown as noted above.

@WhollyMindless

Copy link
Copy Markdown
Contributor Author

@abogartz Thanks for refreshing the branch. I checked 8e91b9d: all four checks pass, including Windows, and the diff against main v0.14.21 is now just the intended seven CI, documentation, and test files. #181 is merged, so that dependency is resolved. The description now reflects this final scope.

Ready for your re-review when convenient; the earlier changes-requested review remains active. It is still fine to decline the parallel-runner proposal if you prefer the existing setup.

@abogartz
abogartz merged commit dba2a7a into abogartz:main Oct 29, 2026
4 checks passed
@abogartz-opencode-self-improvement

Copy link
Copy Markdown

🎉 This PR is included in version 0.14.22 🎉

The release is available on:

Your semantic-release bot 📦🚀

abogartz added a commit that referenced this pull request Nov 1, 2026
…245)

The Windows job turned red on #247 without touching these tests: a
starved --parallel=4 worker spends real time past Bun's default 5s
budget, the test dies, bun kills the dangling racer children, and
finish() rejects after teardown as "racer-d1 exited null". The margins
are measured, not theorized: on the GREEN windows run the prune-sweep
scenario took 5272ms and the viewer-mutation scenario 4990ms against
the 5s default. Bun also applies the default 5s to beforeEach/afterEach
even when the test carries a longer override, so lifecycle-evidence
failed at 8.3s in its hook with a 30s test timeout next door.

Give every test and hook in the three files this family keeps failing
(scenarios-consistency, concurrency, lifecycle-evidence) an explicit
30s budget. No assertion moves; only time is granted. Follows the
precedent set for the reader scenario (#174).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants