test: deflake socket_inet_loopback.
PiperOrigin-RevId: 226350590 Change-Id: Idff080705f644f8f78ce92b53c77eecc37e002e7
This commit is contained in:
parent
86c9bd2547
commit
25d62850ce
|
@ -185,7 +185,12 @@ TEST_P(SocketInetLoopbackTest, TCP) {
|
||||||
SyscallSucceeds());
|
SyscallSucceeds());
|
||||||
|
|
||||||
// Accept the connection.
|
// Accept the connection.
|
||||||
ASSERT_NO_ERRNO_AND_VALUE(Accept(listen_fd.get(), nullptr, nullptr));
|
//
|
||||||
|
// We have to assign a name to the accepted socket, as unamed temporary
|
||||||
|
// objects are destructed upon full evaluation of the expression it is in,
|
||||||
|
// potentially causing the connecting socket to fail to shutdown properly.
|
||||||
|
auto accepted =
|
||||||
|
ASSERT_NO_ERRNO_AND_VALUE(Accept(listen_fd.get(), nullptr, nullptr));
|
||||||
|
|
||||||
ASSERT_THAT(shutdown(listen_fd.get(), SHUT_RDWR), SyscallSucceeds());
|
ASSERT_THAT(shutdown(listen_fd.get(), SHUT_RDWR), SyscallSucceeds());
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue