We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Test_lockQueue_threadSafety
1 parent 6a9d85b commit 223cfbbCopy full SHA for 223cfbb
dot/sync/block_queue_test.go
@@ -219,6 +219,17 @@ func Test_lockQueue_threadSafety(t *testing.T) {
219
}
220
blockHash := common.Hash{1}
221
222
+ endWg.Add(1)
223
+ go func() {
224
+ defer endWg.Done()
225
+ <-ctx.Done()
226
+ // Empty queue channel to make sure `push` does not block
227
+ // when the context is cancelled.
228
+ for len(blockQueue.queue) > 0 {
229
+ <-blockQueue.queue
230
+ }
231
+ }()
232
+
233
for i := 0; i < parallelism; i++ {
234
go runInLoop(func() {
235
blockQueue.push(blockData)
0 commit comments