Safer delays for Realloc test

License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
This commit is contained in:
Hector Sanjuan 2017-07-21 10:34:20 +02:00
parent 5ed5a43432
commit 22ec357793

View File

@ -830,7 +830,7 @@ func TestClustersReplicationRealloc(t *testing.T) {
}
// Let the pin arrive
time.Sleep(time.Second / 2)
delay()
pin := clusters[j].Pins()[0]
pinSerial := pin.ToSerial()
@ -845,7 +845,7 @@ func TestClustersReplicationRealloc(t *testing.T) {
t.Fatal(err)
}
time.Sleep(time.Second / 2)
time.Sleep(time.Second)
pin2 := clusters[j].Pins()[0]
pinSerial2 := pin2.ToSerial()
@ -870,8 +870,9 @@ func TestClustersReplicationRealloc(t *testing.T) {
}
}
// let metrics expire
time.Sleep(2 * time.Second)
// let metrics expire and give time for the cluster to
// see if they have lost the leader
time.Sleep(4 * time.Second)
waitForLeader(t, clusters)
@ -887,7 +888,7 @@ func TestClustersReplicationRealloc(t *testing.T) {
t.Fatal(err)
}
time.Sleep(time.Second / 2)
time.Sleep(time.Second)
numPinned := 0
for i, c := range clusters {