-
Notifications
You must be signed in to change notification settings - Fork 269
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
test(mempool/cat): fix flaky TestTxPool_BroadcastQueue #1321
test(mempool/cat): fix flaky TestTxPool_BroadcastQueue #1321
Conversation
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.
I can't get the flake to reproduce locally before or after this change. @tropicaldog do you mind explaining why this fixes the flake?
@rootulp I think the original code might lead to a race condition, where the goroutine may start consuming transactions before all of them are added. Using time.Sleep(10 * time.Millisecond) to introduce a delay is not a reliable solution imo. |
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.
Thanks for the explanation! I'm on an M1 Mac and the test is still passing on my machine after your fix so LGTM.
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.
unable to reproduce the flake locally on Mac, but this fix looks reasonable to me. There is no need to wait to introduce the delay where we can just broadcast all the transactions before starting to consume them
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.
thanks @tropicaldog
@tropicaldog we have to update this branch by merging main, perhaps you could give one of us perms to do that on your fork so we could merge this? either that, or you will have to merge main again 😅 |
Yeah I guess I didn't have enough permission. Anyway I will merge main now, thanks for your reviews! |
… (#1345) ## Description Closes #1261 <hr>This is an automatic backport of pull request #1321 done by [Mergify](https://mergify.com). Co-authored-by: Tuan Tran <[email protected]>
Description
Closes #1261