test(mempool/cat): fix flaky TestTxPool_BroadcastQueue#1321
test(mempool/cat): fix flaky TestTxPool_BroadcastQueue#1321rootulp merged 3 commits intocelestiaorg:mainfrom
Conversation
rootulp
left a comment
There was a problem hiding this comment.
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. |
rootulp
left a comment
There was a problem hiding this comment.
Thanks for the explanation! I'm on an M1 Mac and the test is still passing on my machine after your fix so LGTM.
rach-id
left a comment
There was a problem hiding this comment.
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
|
@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 <tuantran@notional.ventures>
Description
Closes #1261