(Wangle) Fix tests for clang
[folly.git] / folly / wangle / test / ThreadGateTest.cpp
index ef434ac6fc6d1615062a9494995303155aa31fac..41ae3cb218af4b32bd58482bb4c1ca99ef1c9864 100644 (file)
@@ -145,7 +145,8 @@ TEST_F(GenericThreadGateFixture, gate_with_promise) {
     });
 
   bool eastPromiseMade = false;
-  std::async(std::launch::async, [&p, &eastPromiseMade, this]() {
+  auto thread = std::thread([&p, &eastPromiseMade, this]() {
+    EXPECT_NE(t.get_id(), std::this_thread::get_id());
     // South thread != west thread. p gets set in west thread.
     tg.gate<int>([&p, &eastPromiseMade, this] {
                    EXPECT_EQ(t.get_id(), std::this_thread::get_id());
@@ -162,4 +163,5 @@ TEST_F(GenericThreadGateFixture, gate_with_promise) {
   EXPECT_TRUE(westThenCalled);
   EXPECT_TRUE(eastPromiseMade);
   EXPECT_EQ(f.value(), 1);
+  thread.join();
 }