Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
Derek Collison
2019-07-28 07:10:37 -07:00
parent 5bec08ac6a
commit 507432648b

View File

@@ -190,7 +190,7 @@ func TestUnpromptedPong(t *testing.T) {
func TestPingSuppresion(t *testing.T) {
pingInterval := 100 * time.Millisecond
highWater := 130 * time.Millisecond
opts := DefaultTestOptions
opts.Port = PING_TEST_PORT
opts.PingInterval = pingInterval
@@ -214,7 +214,7 @@ func TestPingSuppresion(t *testing.T) {
t.Fatalf("pingTime too low: %v", pingTime)
}
// +5 is just for fudging in case things are slow in the testing system.
if pingTime > pingInterval+(pingInterval/5)+5 {
if pingTime > highWater {
t.Fatalf("pingTime too high: %v", pingTime)
}