pull/37595/head
Mark D. Roth 3 months ago
parent 7916b88a70
commit 39d083c0f4
  1. 2
      test/core/end2end/tests/retry_cancel_during_delay.cc
  2. 8
      test/cpp/end2end/client_lb_end2end_test.cc

@ -56,7 +56,7 @@ void TestRetryCancelDuringDelay(
35 * grpc_test_slowdown_factor()))); 35 * grpc_test_slowdown_factor())));
auto expect_finish_before = test.TimestampAfterDuration(Duration::Minutes(2)); auto expect_finish_before = test.TimestampAfterDuration(Duration::Minutes(2));
auto c = test.NewClientCall("/service/method") auto c = test.NewClientCall("/service/method")
.Timeout(Duration::Seconds(30)) .Timeout(Duration::Seconds(20))
.Create(); .Create();
EXPECT_NE(c.GetPeer(), absl::nullopt); EXPECT_NE(c.GetPeer(), absl::nullopt);
// Client starts a batch with all 6 ops. // Client starts a batch with all 6 ops.

@ -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);
} }

Loading…
Cancel
Save