Browse Source

bandaid for non-deterministic clist test (#3575)

* add a deterministic timeout

Co-Authored-By: kevlubkcm <36485490+kevlubkcm@users.noreply.github.com>
pull/3578/head
kevlubkcm 6 years ago
committed by Ismail Khoffi
parent
commit
f2aa1bf50e
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      libs/clist/clist_test.go

+ 3
- 1
libs/clist/clist_test.go View File

@ -261,6 +261,8 @@ func TestWaitChan(t *testing.T) {
pushed++
time.Sleep(time.Duration(cmn.RandIntn(25)) * time.Millisecond)
}
// apply a deterministic pause so the counter has time to catch up
time.Sleep(25 * time.Millisecond)
close(done)
}()
@ -273,7 +275,7 @@ FOR_LOOP:
next = next.Next()
seen++
if next == nil {
continue
t.Fatal("Next should not be nil when waiting on NextWaitChan")
}
case <-done:
break FOR_LOOP


Loading…
Cancel
Save