-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support parallel tests in verbose progress reporting #2223
Conversation
b665376
to
5fa1d9c
Compare
LGTM I was pretty sure it would work, but a check would be easy to do. I added the PR to my fork and then added the seed value from the failed macOS 2.5 job. All the MRI jobs failed except the Ruby master jobs, and one outlier, the Ubuntu 2.2 job. Also, all the 'required' non-MRI jobs passed. Interesting. A quick look at the logs seems to show two different causes for the failures? I think. |
test/helper.rb
Outdated
@@ -11,6 +11,8 @@ | |||
end | |||
end | |||
|
|||
$LOAD_PATH.unshift('test') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we omit this? I prefer to not touch the loadpath and leave it on the user to set it up correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The load-path change was so the class would be auto-loaded by Minitest's load_plugin
logic. Updated to manually load the plugin in e299737.
pinging @zenspider to get thoughts + opinion on approach + upstream potential |
Counter patch incoming... |
A direct patch of |
I'm on irc and slack.seattlerb.org right now if you want to discuss realtime. |
Reports correct duration and status for tests run in parallel threads.
5fa1d9c
to
e299737
Compare
I talked to Aaron a bit today and I no longer think that any change needs to be made (here or in minitest). Verbose mode is an opt-in flag and it just doesn't make sense when run in parallel. Instead, use ETA: if you do insist on such a thing (ie, tests only fail in parallel), then I would say verbose mode isn't doing you right and there are other better ways to figure out what's going on. |
If this is the case, that particular combination of options should probably raise an argument error instead of producing incorrect output.
If you have something in mind, can you be more specific? The custom verbose-parallel reporter in this PR was the 'best' example I've been able to come up with without sacrificing performance dropping down to single-thread, if there's something better that already exists then that could be used instead. |
Adds a Minitest plugin to fix verbose progress reporting when running parallel tests.
The default verbose progress reporter interleaves results when test are executed in parallel threads (e.g., in test classes containing
parallelize_me!
), making the printed results entirely useless because the duration/results printed no longer correspond to the correct test names. This made it impossible to debug slow/hanging tests in the CI output and has probably caused all sorts of confusion.The plugin fixes this by printing
…
when another test starts in parallel, and re-prints the test name along with the result when the test finishes.For example, a CI failure on this PR had a test hang, causing the CI action to time out after 10 minutes. The test log shows that the culprit is
TestIntegrationSingle#test_siginfo_thread_print
, since the lineTestIntegrationSingle#test_siginfo_thread_print = …
showing the test started never had a matching line showing the test finished.Your checklist for this pull request
[changelog skip]
the pull request title.[ci skip]
to the title of the PR.#issue
" to the PR description or my commit messages.