ReviewOS

also looking at this

zig-utils/zig-test-framework

fix: enforce bounded parallel test execution

#21
Merged glennmichael123 wants to merge codex/issue-15-bounded-parallel into main
3 files +478 -176
9 days ago

Closes #15.

Replaces one-thread-per-test execution with a bounded scheduler. n_jobs is now an exact concurrency ceiling; omitting it uses the logical CPU count with a one-worker fallback. Suites and nested suites run in declaration order, direct tests run concurrently, and inherited per-test hooks execute on the same worker as their test.

Reporter calls are serialized and results are emitted in declaration order. Nested totals, failure propagation, filters, skips, only-selection, and lifecycle hooks are all handled by the parallel path, while duplicate runner/reporter start/end events are removed.

Tests verify one-worker, two-worker, and CPU-default limits; deterministic event order and totals; pass/fail/skip propagation; and nested hook lifecycle behavior. The thread-safety and hook semantics are documented.

This PR is stacked on #20 so its diff stays scoped to issue #15. Merge #20 first, then retarget this PR to main.

Verification:

  • zig build test repeated three times
  • zig fmt --check .
  • zig build
  • zig build examples
  • zig build -Dtarget=x86_64-linux-gnu

3 changed files on the files tab, with 0 review threads.

Sign in to comment on this pull request.