From c391c5bfcb1492a475d57991576ea4ffe12cfa39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?William=20Tisa=CC=88ter?= Date: Fri, 9 May 2014 01:18:08 +0200 Subject: [PATCH] Remove all sleeps from `health_endpoint_test.go` --- consul/health_endpoint_test.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/consul/health_endpoint_test.go b/consul/health_endpoint_test.go index 465f35846..b3dc39f43 100644 --- a/consul/health_endpoint_test.go +++ b/consul/health_endpoint_test.go @@ -14,8 +14,7 @@ func TestHealth_ChecksInState(t *testing.T) { client := rpcClient(t, s1) defer client.Close() - // Wait for leader - time.Sleep(100 * time.Millisecond) + testutil.WaitForLeader(t, client.Call, "dc1") arg := structs.RegisterRequest{ Datacenter: "dc1", @@ -61,8 +60,7 @@ func TestHealth_NodeChecks(t *testing.T) { client := rpcClient(t, s1) defer client.Close() - // Wait for leader - time.Sleep(100 * time.Millisecond) + testutil.WaitForLeader(t, client.Call, "dc1") arg := structs.RegisterRequest{ Datacenter: "dc1", @@ -103,8 +101,7 @@ func TestHealth_ServiceChecks(t *testing.T) { client := rpcClient(t, s1) defer client.Close() - // Wait for leader - time.Sleep(100 * time.Millisecond) + testutil.WaitForLeader(t, client.Call, "dc1") arg := structs.RegisterRequest{ Datacenter: "dc1", @@ -150,8 +147,7 @@ func TestHealth_ServiceNodes(t *testing.T) { client := rpcClient(t, s1) defer client.Close() - // Wait for leader - time.Sleep(100 * time.Millisecond) + testutil.WaitForLeader(t, client.Call, "dc1") arg := structs.RegisterRequest{ Datacenter: "dc1",