Skip to content

Commit

Permalink
fix flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
EasterTheBunny committed Nov 5, 2024
1 parent c172e46 commit 987e5bd
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion pkg/solana/logpoller/worker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,20 @@ func TestWorkerGroup_Close(t *testing.T) {
group.Close()

mu.RLock()
assert.Equal(t, []int{1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, output)
var finished int
var notFinished int

for _, val := range output {
if val == 1 {
finished++
} else if val == 0 {
notFinished++
}
}
mu.RUnlock()

assert.GreaterOrEqual(t, finished, 1)
assert.GreaterOrEqual(t, notFinished, 1)
}

func TestWorkerGroup_DoContext(t *testing.T) {
Expand Down

0 comments on commit 987e5bd

Please sign in to comment.