From ca695a9e0855d91574f1f52bd442d3e4bdc8b2bf Mon Sep 17 00:00:00 2001 From: Zeling Feng Date: Thu, 8 Feb 2024 11:57:39 -0800 Subject: [PATCH] Increase timeout for TCPLinger2TimeoutAfterClose There have been some timing issues with this test, bump up the margin to decrease flake rate but also decrease the expected sleeping time to not increase the overall test run time. PiperOrigin-RevId: 605385820 --- test/syscalls/linux/socket_inet_loopback_isolated.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/syscalls/linux/socket_inet_loopback_isolated.cc b/test/syscalls/linux/socket_inet_loopback_isolated.cc index 9f80c829e..37bd1bed1 100644 --- a/test/syscalls/linux/socket_inet_loopback_isolated.cc +++ b/test/syscalls/linux/socket_inet_loopback_isolated.cc @@ -267,7 +267,7 @@ TEST_P(SocketInetLoopbackIsolatedTest, TCPLinger2TimeoutAfterClose) { // across a S/R. { DisableSave ds; - constexpr int kTCPLingerTimeout = 5; + constexpr int kTCPLingerTimeout = 4; EXPECT_THAT(setsockopt(conn_fd.get(), IPPROTO_TCP, TCP_LINGER2, &kTCPLingerTimeout, sizeof(kTCPLingerTimeout)), SyscallSucceedsWithValue(0)); @@ -275,7 +275,7 @@ TEST_P(SocketInetLoopbackIsolatedTest, TCPLinger2TimeoutAfterClose) { // close the connecting FD to trigger FIN_WAIT2 on the connected fd. conn_fd.reset(); - absl::SleepFor(absl::Seconds(kTCPLingerTimeout + 1)); + absl::SleepFor(absl::Seconds(kTCPLingerTimeout + 2)); // ds going out of scope will Re-enable S/R's since at this point the timer // must have fired and cleaned up the endpoint.