From 2a5cfd87cd757711629b7e104f5aa2088e49bbd2 Mon Sep 17 00:00:00 2001 From: Nayana Bidari Date: Tue, 16 Apr 2024 10:32:58 -0700 Subject: [PATCH] Disable TCP_CORK flaky test with save-resume Disable the timing related TCP_CORK test as the test expects to not receive any data when packet size < MSS. But with save-resume, the resume may take more than cork timeout (200ms) and sends the packet which makes the test fail. PiperOrigin-RevId: 625378877 --- test/syscalls/linux/BUILD | 1 + test/syscalls/linux/socket_ip_tcp_generic.cc | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/test/syscalls/linux/BUILD b/test/syscalls/linux/BUILD index 4cdc86b6a..3a7a4229b 100644 --- a/test/syscalls/linux/BUILD +++ b/test/syscalls/linux/BUILD @@ -2589,6 +2589,7 @@ cc_library( "socket_ip_tcp_generic.h", ], deps = select_gtest() + [ + "//test/util:save_util", "//test/util:socket_util", "//test/util:temp_path", "//test/util:test_util", diff --git a/test/syscalls/linux/socket_ip_tcp_generic.cc b/test/syscalls/linux/socket_ip_tcp_generic.cc index 92e5a1501..b2fe4465f 100644 --- a/test/syscalls/linux/socket_ip_tcp_generic.cc +++ b/test/syscalls/linux/socket_ip_tcp_generic.cc @@ -28,6 +28,7 @@ #include "absl/memory/memory.h" #include "absl/time/clock.h" #include "absl/time/time.h" +#include "test/util/save_util.h" #include "test/util/socket_util.h" #include "test/util/temp_path.h" #include "test/util/test_util.h" @@ -417,6 +418,11 @@ TEST_P(TCPSocketPairTest, SetTCPCork) { } TEST_P(TCPSocketPairTest, TCPCork) { + // Disable save on this test, this test checks if the data is not recv'd by + // the receiver after enabling TCP_CORK when the size of the packet < MSS. + // But the save/resume may take more than the cork timeout of 200ms causing + // all the corked packets to be sent and makes the test flaky. + const DisableSave ds; auto sockets = ASSERT_NO_ERRNO_AND_VALUE(NewSocketPair()); EXPECT_THAT(setsockopt(sockets->first_fd(), IPPROTO_TCP, TCP_CORK,