From a9870ed1011c8ffc3fd36870efa5438d3e891b37 Mon Sep 17 00:00:00 2001 From: Bruno Dal Bo Date: Wed, 26 Jun 2024 13:31:19 -0700 Subject: [PATCH] Avoid spurious timeout in AcceptedInheritsTCPUserTimeout The purpose of the test is only to verify inheritance, but a tight timeout may cause spurious failures. PiperOrigin-RevId: 647060702 --- test/syscalls/linux/socket_inet_loopback.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/syscalls/linux/socket_inet_loopback.cc b/test/syscalls/linux/socket_inet_loopback.cc index 25bb81800..2d6516178 100644 --- a/test/syscalls/linux/socket_inet_loopback.cc +++ b/test/syscalls/linux/socket_inet_loopback.cc @@ -1252,7 +1252,9 @@ TEST_P(SocketInetLoopbackTest, AcceptedInheritsTCPUserTimeout) { ASSERT_NO_ERRNO_AND_VALUE(AddrPort(listener.family(), listen_addr)); // Set the userTimeout on the listening socket. - constexpr int kUserTimeout = 10; + // Use a large value to avoid a spurious timeout. + // This is not a round number to make it more evident this is not the default. + constexpr int kUserTimeout = 120001; ASSERT_THAT(setsockopt(listen_fd.get(), IPPROTO_TCP, TCP_USER_TIMEOUT, &kUserTimeout, sizeof(kUserTimeout)), SyscallSucceeds());