|
|
@ -982,11 +982,11 @@ TEST_F(PickFirstTest, BackOffInitialReconnect) { |
|
|
|
// Check how long it took.
|
|
|
|
// Check how long it took.
|
|
|
|
const grpc_core::Duration waited = grpc_core::Timestamp::Now() - t0; |
|
|
|
const grpc_core::Duration waited = grpc_core::Timestamp::Now() - t0; |
|
|
|
VLOG(2) << "Waited " << waited.millis() << " milliseconds"; |
|
|
|
VLOG(2) << "Waited " << waited.millis() << " milliseconds"; |
|
|
|
// We should have waited at least kInitialBackOffMs. We substract one to
|
|
|
|
// We should have waited at least kInitialBackOffMs, plus or minus
|
|
|
|
// account for test and precision accuracy drift.
|
|
|
|
// jitter. We give a little more leeway on the high end to account
|
|
|
|
|
|
|
|
// for things taking a little longer than expected in other threads.
|
|
|
|
EXPECT_GE(waited.millis(), |
|
|
|
EXPECT_GE(waited.millis(), |
|
|
|
(kInitialBackOffMs * grpc_test_slowdown_factor()) - 1); |
|
|
|
(kInitialBackOffMs * grpc_test_slowdown_factor()) * 0.8); |
|
|
|
// But not much more.
|
|
|
|
|
|
|
|
EXPECT_LE(waited.millis(), |
|
|
|
EXPECT_LE(waited.millis(), |
|
|
|
(kInitialBackOffMs * grpc_test_slowdown_factor()) * 1.3); |
|
|
|
(kInitialBackOffMs * grpc_test_slowdown_factor()) * 1.3); |
|
|
|
} |
|
|
|
} |
|
|
|