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
This commit is contained in:
Bruno Dal Bo
2024-06-26 13:35:05 -07:00
committed by gVisor bot
parent b0abb4e7fa
commit a9870ed101
+3 -1
View File
@@ -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());