mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-03 11:45:18 +00:00
add fixes for flaky tests (#5146)
While working on tendermint my colleague @jinmannwong fixed a few of the unit tests that we found to be flaky in our CI. We thought that you might find this useful, see below for comments.
This commit is contained in:
@@ -67,14 +67,16 @@ func TestThrottle(test *testing.T) {
|
||||
time.Sleep(longwait)
|
||||
assert.Equal(2, c.Count())
|
||||
|
||||
// send 12, over 2 delay sections, adds 3
|
||||
// send 12, over 2 delay sections, adds 3 or more. It
|
||||
// is possible for more to be added if the overhead
|
||||
// in executing the loop is large
|
||||
short := time.Duration(ms/5) * time.Millisecond
|
||||
for i := 0; i < 13; i++ {
|
||||
t.Set()
|
||||
time.Sleep(short)
|
||||
}
|
||||
time.Sleep(longwait)
|
||||
assert.Equal(5, c.Count())
|
||||
assert.LessOrEqual(5, c.Count())
|
||||
|
||||
close(t.Ch)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user