From fc5af87b463de7e6f3ee754ef14228ba0fda5f5e Mon Sep 17 00:00:00 2001 From: Jamie Liu Date: Mon, 25 Apr 2022 17:36:42 -0700 Subject: [PATCH] Automated rollback of changelist 443736918 PiperOrigin-RevId: 444415265 --- test/util/socket_util.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/util/socket_util.cc b/test/util/socket_util.cc index 4d8ba6d50..650b422ae 100644 --- a/test/util/socket_util.cc +++ b/test/util/socket_util.cc @@ -1075,9 +1075,9 @@ void SetupTimeWaitClose(const TestAddress* listener, ASSERT_THAT(poll(&pfd, 1, kTimeout), SyscallSucceedsWithValue(1)); } - // Close the passive socket. This ensures that it transitions from LAST_ACK to - // CLOSE. - passive_closefd.reset(); + // This sleep is needed to reduce flake to ensure that the passive-close + // ensures the state transitions to CLOSE from LAST_ACK. + absl::SleepFor(absl::Seconds(1)); } constexpr char kRangeFile[] = "/proc/sys/net/ipv4/ip_local_port_range";