diff --git a/ipfscluster_test.go b/ipfscluster_test.go index 62e8dac4..6c42b3c2 100644 --- a/ipfscluster_test.go +++ b/ipfscluster_test.go @@ -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 {