Abort loop on failure

As-is, on failure these will infinite loop, resulting in test timeout
instead of failure.

PiperOrigin-RevId: 254074989
This commit is contained in:
Michael Pratt 2019-06-19 14:47:01 -07:00 committed by gVisor bot
parent 9d2efaac5a
commit 773423a997
1 changed files with 2 additions and 2 deletions

View File

@ -268,7 +268,7 @@ TEST_P(TcpSocketTest, BlockingLargeWrite_NoRandomSave) {
char readbuf[2500] = {};
int n = -1;
while (n != 0) {
EXPECT_THAT(n = RetryEINTR(read)(t_, &readbuf, sizeof(readbuf)),
ASSERT_THAT(n = RetryEINTR(read)(t_, &readbuf, sizeof(readbuf)),
SyscallSucceeds());
read_bytes += n;
}
@ -345,7 +345,7 @@ TEST_P(TcpSocketTest, BlockingLargeSend_NoRandomSave) {
char readbuf[2500] = {};
int n = -1;
while (n != 0) {
EXPECT_THAT(n = RetryEINTR(read)(t_, &readbuf, sizeof(readbuf)),
ASSERT_THAT(n = RetryEINTR(read)(t_, &readbuf, sizeof(readbuf)),
SyscallSucceeds());
read_bytes += n;
}