mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Skip TCP_DEFER_ACCEPT test if we sleep for longer than timeout
FIXED: https://fxbug.dev/326254381 PiperOrigin-RevId: 615470990
This commit is contained in:
committed by
gVisor bot
parent
d5f24ea92a
commit
aff56ec25d
@@ -1571,7 +1571,13 @@ TEST_P(SocketInetLoopbackTest, TCPDeferAcceptTimeout) {
|
||||
|
||||
// Verify that there is no acceptable connection before TCP_DEFER_ACCEPT
|
||||
// timeout is hit.
|
||||
const auto start = absl::Now();
|
||||
absl::SleepFor(absl::Seconds(kTCPDeferAccept - 1));
|
||||
// It's possible that we ended up sleeping for longer than the
|
||||
// TCP_DEFER_ACCEPT timeout. If this happens, skip this test.
|
||||
if (absl::Now() >= start + absl::Seconds(kTCPDeferAccept)) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
ASSERT_THAT(accept(listen_fd.get(), nullptr, nullptr),
|
||||
SyscallFailsWithErrno(EWOULDBLOCK));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user