Deflake some AsyncSSLSocket tests.
authorKyle Nekritz <knekritz@fb.com>
Fri, 1 Sep 2017 16:13:58 +0000 (09:13 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Fri, 1 Sep 2017 16:19:57 +0000 (09:19 -0700)
Summary: Fulfilling starts destroying the evb in another thread which races with the socket closing on the evb.

Reviewed By: siyengar, ngoyal

Differential Revision: D5755271

fbshipit-source-id: ace37eee63e684c97ca0fe503293eee83514e0ac

folly/io/async/test/AsyncSSLSocketTest2.cpp

index ae9ef53fa8c4bb28fbf780f6b1eeb00019a28ade..c50b6a7db89459b9e978e54f7ee62686fb415479 100644 (file)
@@ -206,13 +206,13 @@ class ConnectClient : public AsyncSocket::ConnectCallback {
   }
 
   void connectSuccess() noexcept override {
-    promise_.setValue(true);
     socket_.reset();
+    promise_.setValue(true);
   }
 
   void connectErr(const AsyncSocketException& /* ex */) noexcept override {
-    promise_.setValue(false);
     socket_.reset();
+    promise_.setValue(false);
   }
 
   void setCtx(std::shared_ptr<SSLContext> ctx) {