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!
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!