Compare commits

...

No commits in common. 'd52758759da2d2e52d6fb1917e7b55edfbff7518' and 'd28e60d19f9315a494f6d252f19698420f2823a1' have entirely different histories.

  1. 19
      waitfor_test.go

19
waitfor_test.go

@ -37,3 +37,22 @@ func TestSuccess(t *testing.T) {
assert.True(ok)
assert.True(time.Since(start).Milliseconds() < 10)
}
func TestInfiniteLimit(t *testing.T) {
assert := assert.New(t)
var conn net.Listener
go func() {
time.Sleep(time.Millisecond)
var err error
conn, err = net.Listen(`tcp`, `127.0.0.1:65398`)
assert.NoError(err)
}()
start := time.Now()
ok := Try(`tcp`, `127.0.0.1:65398`, time.Microsecond*100, time.Millisecond*-1)
assert.True(ok)
assert.True(time.Since(start).Milliseconds() < 2)
conn.Close()
}

Loading…
Cancel
Save