From 39d083c0f45de917152e61a18dcc1b2f5e2ff3ba Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Thu, 29 Aug 2024 17:13:50 +0000 Subject: [PATCH] fix tests --- test/core/end2end/tests/retry_cancel_during_delay.cc | 2 +- test/cpp/end2end/client_lb_end2end_test.cc | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/core/end2end/tests/retry_cancel_during_delay.cc b/test/core/end2end/tests/retry_cancel_during_delay.cc index 3c825dabc97..57c1c825b4d 100644 --- a/test/core/end2end/tests/retry_cancel_during_delay.cc +++ b/test/core/end2end/tests/retry_cancel_during_delay.cc @@ -56,7 +56,7 @@ void TestRetryCancelDuringDelay( 35 * grpc_test_slowdown_factor()))); auto expect_finish_before = test.TimestampAfterDuration(Duration::Minutes(2)); auto c = test.NewClientCall("/service/method") - .Timeout(Duration::Seconds(30)) + .Timeout(Duration::Seconds(20)) .Create(); EXPECT_NE(c.GetPeer(), absl::nullopt); // Client starts a batch with all 6 ops. diff --git a/test/cpp/end2end/client_lb_end2end_test.cc b/test/cpp/end2end/client_lb_end2end_test.cc index e4b3de512ae..2bc135f1558 100644 --- a/test/cpp/end2end/client_lb_end2end_test.cc +++ b/test/cpp/end2end/client_lb_end2end_test.cc @@ -982,11 +982,11 @@ TEST_F(PickFirstTest, BackOffInitialReconnect) { // Check how long it took. const grpc_core::Duration waited = grpc_core::Timestamp::Now() - t0; VLOG(2) << "Waited " << waited.millis() << " milliseconds"; - // We should have waited at least kInitialBackOffMs. We substract one to - // account for test and precision accuracy drift. + // We should have waited at least kInitialBackOffMs, plus or minus + // 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(), - (kInitialBackOffMs * grpc_test_slowdown_factor()) - 1); - // But not much more. + (kInitialBackOffMs * grpc_test_slowdown_factor()) * 0.8); EXPECT_LE(waited.millis(), (kInitialBackOffMs * grpc_test_slowdown_factor()) * 1.3); }