Repository navigation
Fix generic parallel adapter opt-out and result wait ordering - #1209
Merged
sferik merged 5 commits intoJun 21, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes two parallel coordination edge cases in SimpleCov: (1) ensuring SimpleCov.parallel_tests false truly opts out of env-var-driven parallel coordination, and (2) fixing result merge ordering so the reporting worker’s own result is counted before waiting for siblings.
Changes:
- Store the current worker’s result before waiting for other workers, avoiding
N-1 of Nwait timeouts in the reporting process. - Make the generic
TEST_ENV_NUMBERparallel adapter respectSimpleCov.parallel_tests false. - Add regression specs covering the new wait/store ordering and the generic adapter opt-out behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| spec/simplecov_spec.rb | Adds a spec asserting store → wait → merge call ordering during result merging. |
| spec/parallel_adapters_spec.rb | Adds a spec ensuring GenericAdapter is inactive when SimpleCov.parallel_tests is explicitly false. |
| lib/simplecov/result_processing.rb | Reorders store vs wait to include the reporting worker’s result before polling for siblings. |
| lib/simplecov/parallel_adapters/generic.rb | Prevents GenericAdapter from activating when parallel coordination is opted out. |
| CHANGELOG.md | Documents the behavior changes for adapter opt-out and merge ordering. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
sferik
approved these changes
Jun 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes two parallel coordination issues found while using SimpleCov with an env-var-only parallel runner:
SimpleCov.parallel_tests falsenow disables the genericTEST_ENV_NUMBERadapter as well as theparallel_testsgem adapter.N-1 of Nbefore producing a complete merged report.Closes #1208.
Why
The generic adapter honors the same
TEST_ENV_NUMBER/PARALLEL_TEST_GROUPSenvironment shape as several parallel runners. If a project opts out withSimpleCov.parallel_tests false, SimpleCov should not re-enter parallel coordination through the generic adapter.For result merging, the previous ordering waited for all expected resultset entries before storing the final worker's own result. That made
PARALLEL_TEST_GROUPSimpossible to satisfy in the final worker until after the wait had already timed out.Test
SIMPLECOV_NO_DOGFOOD=1 bundle exec rspec spec/simplecov_spec.rb spec/parallel_adapters_spec.rb