-
Notifications
You must be signed in to change notification settings - Fork 20.1k
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
cmd/geth: fixed parallelized tests #22002
Conversation
eth/downloader/downloader_test.go
Outdated
@@ -1490,7 +1490,6 @@ func testFakedSyncProgress(t *testing.T, protocol int, mode SyncMode) { | |||
// This test reproduces an issue where unexpected deliveries would | |||
// block indefinitely if they arrived at the right time. | |||
func TestDeliverHeadersHang(t *testing.T) { | |||
t.Parallel() |
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.
You removed this -- was that intentional?
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.
Yes, because we call t.Parallel() in the subtests already, calling it twice doesn't really make sense
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.
Ah, but those are different.
This one means
- This test can be run in parallel (with other tests in this module)
The other one means
- These subtests can be run in parallel (with eachother)
If you call Parallel
twice on a t
, it'll panic btw, so there's never any calling it twice
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.
Good catches, only one nitpick!
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.
LGTM, let's merge after #21482
please rebase |
8b00448
to
ba0ae98
Compare
Two tests in our codebase use the
t.Parallel()
in an unsafe way which results in only the last test in a test table being executed.For example master prouduces:
while this branch produces:
When printing out the tested protocol.
See also: https://gist.github.com/posener/92a55c4cd441fc5e5e85f27bca008721