Problem
Parallel execution accepts a job count, but the current implementation starts one thread per test. The configured n_jobs value does not bound concurrency, which can exhaust resources in large suites.
Proposed work
- Replace per-test thread creation with a bounded worker pool or equivalent scheduler.
- Respect
--jobs Nexactly. - Choose a documented CPU-based default when jobs are omitted.
- Preserve deterministic result reporting and thread-safe state updates.
- Ensure hooks and nested suites have explicit concurrency semantics.
Acceptance criteria
- Active test concurrency never exceeds the configured job count.
- Tests verify limits for one, two, and default worker configurations.
- Reporter events and final totals remain correct under concurrency.
- Hook ordering and thread-safety expectations are documented.