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
This commit is contained in:
Zeling Feng
2024-02-08 12:00:59 -08:00
committed by gVisor bot
parent f282345e8c
commit ca695a9e08
@@ -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.