From 69eef2b4551fca263818cf595f78e6f1fbadc6b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?William=20Tisa=CC=88ter?= Date: Fri, 9 May 2014 02:06:19 +0200 Subject: [PATCH] Remove all sleeps from `status_endpoint_test.go --- command/agent/status_endpoint_test.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/command/agent/status_endpoint_test.go b/command/agent/status_endpoint_test.go index 835b80bd9f..4dd1f4e204 100644 --- a/command/agent/status_endpoint_test.go +++ b/command/agent/status_endpoint_test.go @@ -3,7 +3,7 @@ package agent import ( "os" "testing" - "time" + "github.com/hashicorp/consul/testutil" ) func TestStatusLeader(t *testing.T) { @@ -12,8 +12,7 @@ func TestStatusLeader(t *testing.T) { defer srv.Shutdown() defer srv.agent.Shutdown() - // Wait for a leader - time.Sleep(100 * time.Millisecond) + testutil.WaitForLeader(t, srv.agent.RPC, "dc1") obj, err := srv.StatusLeader(nil, nil) if err != nil {