hashicorp / raft-wal

experimental raft storage
Mozilla Public License 2.0
86 stars 8 forks source link

verifier: Fix non-deterministic test #16

Closed banks closed 1 year ago

banks commented 1 year ago

This test was faiing in CI but passing locally.

Eventually I realised I could replicate the failure locally with GOMAXPROCS=1.

The inline comment explains why.

This uses a more robust way to block and unblock the reportFn while also being able to notify when the reportFn hits the block so that we can ensure the background goroutine and channel buffer are in exactly the expected state before moving on.

If reviewers are unsure: the biggest recommendation here is that CI is green now!