From 6fb93e79c2638743158457617e079ffb342dd98d Mon Sep 17 00:00:00 2001 From: AJ Heller Date: Thu, 22 Feb 2024 13:03:12 -0800 Subject: [PATCH] [test] Decrease ping timeout on CancelAfterInvoke tests (#35969) Supersedes #35967 Closes #35969 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35969 from drfloob:land/35967 30a69473435afd2bdc1dc784c745503734ea47d2 PiperOrigin-RevId: 609471457 --- test/core/end2end/tests/cancel_after_invoke.cc | 4 ++++ .../end2end/tests/retry_cancel_after_first_attempt_starts.cc | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/test/core/end2end/tests/cancel_after_invoke.cc b/test/core/end2end/tests/cancel_after_invoke.cc index 59db7db0162..0361230591a 100644 --- a/test/core/end2end/tests/cancel_after_invoke.cc +++ b/test/core/end2end/tests/cancel_after_invoke.cc @@ -81,6 +81,8 @@ void CancelAfterInvoke5(CoreEnd2endTest& test, void CancelAfterInvoke4(CoreEnd2endTest& test, std::unique_ptr mode, Duration timeout) { + test.InitClient(ChannelArgs()); + test.InitServer(ChannelArgs().Set(GRPC_ARG_PING_TIMEOUT_MS, 5000)); auto c = test.NewClientCall("/service/method").Timeout(timeout).Create(); CoreEnd2endTest::IncomingStatusOnClient server_status; CoreEnd2endTest::IncomingMetadata server_initial_metadata; @@ -99,6 +101,8 @@ void CancelAfterInvoke4(CoreEnd2endTest& test, void CancelAfterInvoke3(CoreEnd2endTest& test, std::unique_ptr mode, Duration timeout) { + test.InitClient(ChannelArgs()); + test.InitServer(ChannelArgs().Set(GRPC_ARG_PING_TIMEOUT_MS, 5000)); auto c = test.NewClientCall("/service/method").Timeout(timeout).Create(); CoreEnd2endTest::IncomingStatusOnClient server_status; CoreEnd2endTest::IncomingMetadata server_initial_metadata; diff --git a/test/core/end2end/tests/retry_cancel_after_first_attempt_starts.cc b/test/core/end2end/tests/retry_cancel_after_first_attempt_starts.cc index e8998799f40..91e7c16c996 100644 --- a/test/core/end2end/tests/retry_cancel_after_first_attempt_starts.cc +++ b/test/core/end2end/tests/retry_cancel_after_first_attempt_starts.cc @@ -20,6 +20,7 @@ #include +#include "src/core/ext/transport/chttp2/transport/internal.h" #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/gprpp/time.h" #include "test/core/end2end/end2end_tests.h" @@ -30,7 +31,7 @@ namespace { // Tests that we can unref a call after the first attempt starts but // before any ops complete. This should not cause a memory leak. CORE_END2END_TEST(RetryTest, RetryCancelAfterFirstAttemptStarts) { - InitServer(ChannelArgs()); + InitServer(ChannelArgs().Set(GRPC_ARG_PING_TIMEOUT_MS, 4000)); InitClient(ChannelArgs().Set( GRPC_ARG_SERVICE_CONFIG, "{\n" @@ -48,7 +49,7 @@ CORE_END2END_TEST(RetryTest, RetryCancelAfterFirstAttemptStarts) { " } ]\n" "}")); absl::optional c = - NewClientCall("/service/method").Timeout(Duration::Seconds(5)).Create(); + NewClientCall("/service/method").Timeout(Duration::Seconds(6)).Create(); // Client starts send ops. c->NewBatch(1) .SendInitialMetadata({})