-
Notifications
You must be signed in to change notification settings - Fork 215
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
[Merged by Bors] - Add sleep to make data race less likely #6231
Closed
Conversation
This file contains 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
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #6231 +/- ##
=======================================
Coverage 82.0% 82.1%
=======================================
Files 309 309
Lines 34120 34120
=======================================
+ Hits 28010 28018 +8
+ Misses 4327 4320 -7
+ Partials 1783 1782 -1 ☔ View full report in Codecov by Sentry. |
poszu
approved these changes
Aug 8, 2024
bors merge |
spacemesh-bors bot
pushed a commit
that referenced
this pull request
Aug 8, 2024
## Motivation This adds sleeps to tests in the `fetch` package to hopefully make data races less likely.
Build failed: |
bors merge |
spacemesh-bors bot
pushed a commit
that referenced
this pull request
Aug 8, 2024
## Motivation This adds sleeps to tests in the `fetch` package to hopefully make data races less likely.
Build failed: |
bors merge |
spacemesh-bors bot
pushed a commit
that referenced
this pull request
Aug 8, 2024
## Motivation This adds sleeps to tests in the `fetch` package to hopefully make data races less likely.
Build failed:
|
bors merge |
spacemesh-bors bot
pushed a commit
that referenced
this pull request
Aug 8, 2024
## Motivation This adds sleeps to tests in the `fetch` package to hopefully make data races less likely.
Pull request successfully merged into develop. Build succeeded: |
spacemesh-bors
bot
changed the title
Add sleep to make data race less likely
[Merged by Bors] - Add sleep to make data race less likely
Aug 8, 2024
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.
Motivation
This adds sleeps to tests in the
fetch
package to hopefully make data races less likely.Description
libp2p/go-libp2p-pubsub
internally uses a go routine with a for loop that only returns when the context is canceled. See the code here: https://github.com/libp2p/go-libp2p-pubsub/blob/19ffbb3a482caecabb8520917c631e3047a78094/pubsub.go#L668-L671Since this signal might not reach the go routine before the test ends the log that is emitted might use the test logger of a different test causing a race. Since there is no way to not use a global logger or any signal back from
PubSub
that the go routine exited, the only thing we can do without changinglibp2p/go-libp2p-pubsub
is to sleep in the test for some time and hope that ensures the go routine exited.Test Plan
existing tests pass and are less flaky
TODO