Fixed unstable test TestRTTCommand_LAN in command/rtt (#4585)

This commit is contained in:
Pierre Souchay 2018-08-27 17:37:13 +02:00 committed by Freddy
parent 3f9d1370b7
commit af90c88f6a
1 changed files with 4 additions and 0 deletions

View File

@ -5,6 +5,8 @@ import (
"strings"
"testing"
"github.com/hashicorp/consul/testrpc"
"github.com/hashicorp/consul/agent"
"github.com/hashicorp/consul/agent/structs"
"github.com/hashicorp/consul/testutil/retry"
@ -52,6 +54,7 @@ func TestRTTCommand_LAN(t *testing.T) {
}
`)
defer a.Shutdown()
testrpc.WaitForLeader(t, a.RPC, "dc1")
// Inject some known coordinates.
c1 := coordinate.NewCoordinate(coordinate.DefaultConfig())
@ -154,6 +157,7 @@ func TestRTTCommand_WAN(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
testrpc.WaitForLeader(t, a.RPC, "dc1")
node := fmt.Sprintf("%s.%s", a.Config.NodeName, a.Config.Datacenter)