Set send bufer size in the test BlockingPartialWriteClosed.

Fix the flaky test BlockingPartialWriteClosed by setting the send buffer size
to disable auto-tuning.

Before: http://sponge2/d5557791-88e3-491c-b3d8-733fcf4ca526
After: http://sponge2/4ee46189-c50a-4f49-a03c-7ed70d5dcf76
PiperOrigin-RevId: 538567854
This commit is contained in:
Nayana Bidari
2023-06-07 12:57:04 -07:00
committed by gVisor bot
parent f815fa9079
commit 60e4fec168
@@ -39,6 +39,13 @@ TEST_P(BlockingStreamSocketPairTest, BlockPartialWriteClosed) {
auto sockets = ASSERT_NO_ERRNO_AND_VALUE(NewSocketPair());
// Set the send buffer size which will disable auto tuning and will block the
// partial write while sending the data more than the send buffer size.
constexpr int kSndBufSz = INT_MAX;
ASSERT_THAT(setsockopt(sockets->first_fd(), SOL_SOCKET, SO_SNDBUF, &kSndBufSz,
sizeof(kSndBufSz)),
SyscallSucceeds());
int buffer_size;
socklen_t length = sizeof(buffer_size);
ASSERT_THAT(getsockopt(sockets->first_fd(), SOL_SOCKET, SO_SNDBUF,