From 773423a997eb19c48942ccb8a390be72bbd9d5e1 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Wed, 19 Jun 2019 14:47:01 -0700 Subject: [PATCH] Abort loop on failure As-is, on failure these will infinite loop, resulting in test timeout instead of failure. PiperOrigin-RevId: 254074989 --- test/syscalls/linux/tcp_socket.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/syscalls/linux/tcp_socket.cc b/test/syscalls/linux/tcp_socket.cc index e95b644ac..5efeb96c8 100644 --- a/test/syscalls/linux/tcp_socket.cc +++ b/test/syscalls/linux/tcp_socket.cc @@ -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; }