Tune TCP syscall test

Change the parameters for filling the send buffer:
1. Use a larger buffer to account for the fact that the real send buffer is
larger than the size we set.
2. Use a longer sleep duration to reduce the chance of flakes.

PiperOrigin-RevId: 528562364
This commit is contained in:
Zeling Feng
2023-05-01 13:42:05 -07:00
committed by gVisor bot
parent 8218095436
commit 389cc75f10
+2 -2
View File
@@ -126,13 +126,13 @@ static void FillSocketBuffers(int sender, int receiver) {
SyscallSucceedsWithValue(0));
// Create a large buffer that will be used for sending.
std::vector<char> buf(1 << 16);
std::vector<char> buf(buf_sz << 2);
// Write until we receive an error.
while (RetryEINTR(send)(sender, buf.data(), buf.size(), 0) != -1) {
// Sleep to give linux a chance to move data from the send buffer to the
// receive buffer.
usleep(10000); // 10ms.
usleep(100000); // 100ms.
}
// The last error should have been EWOULDBLOCK.
ASSERT_EQ(errno, EWOULDBLOCK);