From: Marcin Pawlowski Date: Sat, 12 Nov 2016 02:37:38 +0000 (-0800) Subject: try to improve folly/io/async/test:async_test - AsyncSocketTest.Write X-Git-Tag: v2016.11.14.00~3 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=8c88eb0aee3389066d5c43d34148bee92e9ec773;p=folly.git try to improve folly/io/async/test:async_test - AsyncSocketTest.Write 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 --- diff --git a/folly/io/async/test/AsyncSocketTest2.cpp b/folly/io/async/test/AsyncSocketTest2.cpp index d1f4971d..02650418 100644 --- a/folly/io/async/test/AsyncSocketTest2.cpp +++ b/folly/io/async/test/AsyncSocketTest2.cpp @@ -1067,7 +1067,7 @@ TEST(AsyncSocketTest, WritePipeError) { // accept and immediately close the socket std::shared_ptr acceptedSocket = server.accept(); - acceptedSocket.reset(); + acceptedSocket->close(); // write() a large chunk of data size_t writeLength = 8*1024*1024;