Fixed unstable test TestProxy_public (#4587)

This commit is contained in:
Pierre Souchay 2018-08-27 17:45:07 +02:00 committed by Freddy
parent 73824ab65f
commit 0c2d9b0782
1 changed files with 3 additions and 0 deletions

View File

@ -7,6 +7,8 @@ import (
"os" "os"
"testing" "testing"
"github.com/hashicorp/consul/testrpc"
"github.com/hashicorp/consul/agent" "github.com/hashicorp/consul/agent"
agConnect "github.com/hashicorp/consul/agent/connect" agConnect "github.com/hashicorp/consul/agent/connect"
"github.com/hashicorp/consul/api" "github.com/hashicorp/consul/api"
@ -25,6 +27,7 @@ func TestProxy_public(t *testing.T) {
a := agent.NewTestAgent(t.Name(), "") a := agent.NewTestAgent(t.Name(), "")
defer a.Shutdown() defer a.Shutdown()
client := a.Client() client := a.Client()
testrpc.WaitForLeader(t, a.RPC, "dc1")
// Register the service so we can get a leaf cert // Register the service so we can get a leaf cert
_, err := client.Catalog().Register(&api.CatalogRegistration{ _, err := client.Catalog().Register(&api.CatalogRegistration{