Wait for any route, not exactly one: 2.11 pools routes between two servers
This commit is contained in:
@@ -166,7 +166,7 @@ func routes(ip string) int {
|
||||
func waitRoutes(e *env, want int, limit time.Duration) time.Duration {
|
||||
t0 := time.Now()
|
||||
for time.Since(t0) < limit {
|
||||
if routes(e.k.B) == want && routes(e.k.C) == want {
|
||||
if rb, rc := routes(e.k.B), routes(e.k.C); (want == 0 && rb == 0 && rc == 0) || (want > 0 && rb >= want && rc >= want) {
|
||||
return time.Since(t0)
|
||||
}
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
|
||||
Reference in New Issue
Block a user