mirror of
https://github.com/fluencelabs/tendermint
synced 2025-07-31 20:21:56 +00:00
fixed race condition reported in issue #881
This commit is contained in:
@@ -210,7 +210,10 @@ func TestTrustMetricStopPause(t *testing.T) {
|
||||
// Give the pause some time to take place
|
||||
time.Sleep(10 * time.Millisecond)
|
||||
|
||||
tm.mtx.Lock()
|
||||
first := tm.numIntervals
|
||||
tm.mtx.Unlock()
|
||||
|
||||
// Allow more time to pass and check the intervals are unchanged
|
||||
time.Sleep(50 * time.Millisecond)
|
||||
assert.Equal(t, first, tm.numIntervals)
|
||||
@@ -223,7 +226,10 @@ func TestTrustMetricStopPause(t *testing.T) {
|
||||
// Give the stop some time to take place
|
||||
time.Sleep(10 * time.Millisecond)
|
||||
|
||||
tm.mtx.Lock()
|
||||
second := tm.numIntervals
|
||||
tm.mtx.Unlock()
|
||||
|
||||
// Allow more time to pass and check the intervals are unchanged
|
||||
time.Sleep(50 * time.Millisecond)
|
||||
assert.Equal(t, second, tm.numIntervals)
|
||||
|
Reference in New Issue
Block a user