From 5a56d8a2c6ab3748438bfdd0e70dce584b552d83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?William=20Tisa=CC=88ter?= Date: Fri, 9 May 2014 01:23:54 +0200 Subject: [PATCH] Remove all sleeps from `status_endpoint_test.go` --- consul/status_endpoint_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/consul/status_endpoint_test.go b/consul/status_endpoint_test.go index 683b4bb74..75ff51947 100644 --- a/consul/status_endpoint_test.go +++ b/consul/status_endpoint_test.go @@ -1,6 +1,7 @@ package consul import ( + "github.com/hashicorp/consul/testutil" "github.com/ugorji/go/codec" "net" "net/rpc" @@ -38,7 +39,7 @@ func TestStatusLeader(t *testing.T) { t.Fatalf("unexpected leader: %v", leader) } - time.Sleep(100 * time.Millisecond) + testutil.WaitForLeader(t, client.Call, "dc1") if err := client.Call("Status.Leader", arg, &leader); err != nil { t.Fatalf("err: %v", err)