From 136df63e2cecca3789fcb00683a72cffbc88c9b3 Mon Sep 17 00:00:00 2001 From: Alvin Huang Date: Thu, 21 Feb 2019 16:27:17 -0500 Subject: [PATCH] add retry to TestResetSessionTimerLocked --- agent/consul/session_ttl_test.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/agent/consul/session_ttl_test.go b/agent/consul/session_ttl_test.go index de33ee5d02..9f7c0e2414 100644 --- a/agent/consul/session_ttl_test.go +++ b/agent/consul/session_ttl_test.go @@ -162,10 +162,11 @@ func TestResetSessionTimerLocked(t *testing.T) { t.Fatalf("missing timer") } - time.Sleep(10 * time.Millisecond * structs.SessionTTLMultiplier) - if s1.sessionTimers.Get("foo") != nil { - t.Fatalf("timer should be gone") - } + retry.Run(t, func(r *retry.R) { + if s1.sessionTimers.Get("foo") != nil { + r.Fatal("timer should be gone") + } + }) } func TestResetSessionTimerLocked_Renew(t *testing.T) {