mirror of https://github.com/status-im/consul.git
Remove some sleeps from `local_test.go`
This commit is contained in:
parent
0d90e480b6
commit
4179b9dfe4
|
@ -1,6 +1,7 @@
|
|||
package agent
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/consul/testutil"
|
||||
"github.com/hashicorp/consul/consul/structs"
|
||||
"os"
|
||||
"reflect"
|
||||
|
@ -14,18 +15,16 @@ func TestAgentAntiEntropy_Services(t *testing.T) {
|
|||
defer os.RemoveAll(dir)
|
||||
defer agent.Shutdown()
|
||||
|
||||
// Wait for a leader
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
|
||||
// Register info
|
||||
args := &structs.RegisterRequest{
|
||||
Datacenter: "dc1",
|
||||
Node: agent.config.NodeName,
|
||||
Address: "127.0.0.1",
|
||||
}
|
||||
var out struct{}
|
||||
|
||||
// Exists both, same (noop)
|
||||
testutil.WaitForLeader(t, agent.RPC, args)
|
||||
|
||||
// Register info. Exists both, same (noop)
|
||||
var out struct{}
|
||||
srv1 := &structs.NodeService{
|
||||
ID: "mysql",
|
||||
Service: "mysql",
|
||||
|
@ -137,18 +136,16 @@ func TestAgentAntiEntropy_Checks(t *testing.T) {
|
|||
defer os.RemoveAll(dir)
|
||||
defer agent.Shutdown()
|
||||
|
||||
// Wait for a leader
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
|
||||
// Register info
|
||||
args := &structs.RegisterRequest{
|
||||
Datacenter: "dc1",
|
||||
Node: agent.config.NodeName,
|
||||
Address: "127.0.0.1",
|
||||
}
|
||||
var out struct{}
|
||||
|
||||
// Exists both, same (noop)
|
||||
testutil.WaitForLeader(t, agent.RPC, args)
|
||||
|
||||
// Register info. Exists both, same (noop)
|
||||
var out struct{}
|
||||
chk1 := &structs.HealthCheck{
|
||||
Node: agent.config.NodeName,
|
||||
CheckID: "mysql",
|
||||
|
|
Loading…
Reference in New Issue