mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 21:31:37 +00:00
The TestCountdownShouldBeAbleToStop test was failing intermittently due to a race condition in the StopTimer() implementation. Previously, the goroutine used defer to set initilised=false, which executed after close(q) signaled completion to StopTimer(). This allowed StopTimer() to return before the state was properly cleaned up, causing isInitilised() checks to occasionally see stale true values. Fixed by explicitly calling setInitilised(false) before close(q), ensuring the state is updated atomically before StopTimer() returns. This eliminates the race condition and makes the test pass consistently. Verified by running the test 30 times consecutively with no failures. |
||
|---|---|---|
| .. | ||
| countdown.go | ||
| countdown_test.go | ||
| exp_duration.go | ||
| exp_duration_test.go | ||