[ORC][RPC] Join server thread before checking condition in unit test.
authorLang Hames <lhames@gmail.com>
Fri, 6 Sep 2019 21:55:43 +0000 (21:55 +0000)
committerLang Hames <lhames@gmail.com>
Fri, 6 Sep 2019 21:55:43 +0000 (21:55 +0000)
Otherwise we have a race on the sent-messages count.

llvm-svn: 371263

llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp

index 8e4c533..2a0ed07 100644 (file)
@@ -214,6 +214,8 @@ TEST(DummyRPC, TestCallAsyncVoidBool) {
     EXPECT_FALSE(!!Err) << "Client failed to handle response from void(bool)";
   }
 
+  ServerThread.join();
+
   // The client should have made two calls to send: One implicit call to
   // negotiate the VoidBool function key, and a second to make the VoidBool
   // call.
@@ -224,8 +226,6 @@ TEST(DummyRPC, TestCallAsyncVoidBool) {
   // the negotiate call, and another to send the response to the VoidBool call.
   EXPECT_EQ(Channels.second->SendCalls, 2U)
       << "Expected two send calls to have been made by server";
-
-  ServerThread.join();
 }
 
 TEST(DummyRPC, TestCallAsyncIntInt) {