try to improve folly/io/async/test:async_test - AsyncSocketTest.Write
authorMarcin Pawlowski <mpawlowski@fb.com>
Sat, 12 Nov 2016 02:37:38 +0000 (18:37 -0800)
committerFacebook Github Bot <facebook-github-bot-bot@fb.com>
Sat, 12 Nov 2016 02:38:50 +0000 (18:38 -0800)
Summary:
the test fails a lot as seen on the task.
To kill the connection in said test, we depeneded
on destructor, however this uses a delayed destruction
patter so I guess we did not destroy on time and
we were failing the tests.
I close socket explicitly. No idea if this misses
the point of whole test.

Reviewed By: yfeldblum

Differential Revision: D4171111

fbshipit-source-id: 01b8c97a04a2bcdfaeeea522ca8bcae343d6bb5d

folly/io/async/test/AsyncSocketTest2.cpp

index d1f4971d3d89d3dd5dd5476cd44e0635a1a6c644..02650418d7a67b00b7cfa63cfc7f8cb245c6645a 100644 (file)
@@ -1067,7 +1067,7 @@ TEST(AsyncSocketTest, WritePipeError) {
 
   // accept and immediately close the socket
   std::shared_ptr<BlockingSocket> acceptedSocket = server.accept();
-  acceptedSocket.reset();
+  acceptedSocket->close();
 
   // write() a large chunk of data
   size_t writeLength = 8*1024*1024;