From d6f3dc510c08d2d177ed76a2fab07599946fa98d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?William=20Tisa=CC=88ter?= Date: Fri, 9 May 2014 02:11:40 +0200 Subject: [PATCH] Remove all sleeps from `internal_endpoint_test.go` --- consul/internal_endpoint_test.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/consul/internal_endpoint_test.go b/consul/internal_endpoint_test.go index a5ff17373..9b08fe74d 100644 --- a/consul/internal_endpoint_test.go +++ b/consul/internal_endpoint_test.go @@ -1,10 +1,10 @@ package consul import ( + "github.com/hashicorp/consul/testutil" "github.com/hashicorp/consul/consul/structs" "os" "testing" - "time" ) func TestInternal_NodeInfo(t *testing.T) { @@ -14,8 +14,7 @@ func TestInternal_NodeInfo(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", @@ -68,8 +67,7 @@ func TestInternal_NodeDump(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",