[llvm] r371263 - [ORC][RPC] Join server thread before checking condition in unit test.

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 6 14:55:43 PDT 2019


Author: lhames
Date: Fri Sep  6 14:55:43 2019
New Revision: 371263

URL: http://llvm.org/viewvc/llvm-project?rev=371263&view=rev
Log:
[ORC][RPC] Join server thread before checking condition in unit test.

Otherwise we have a race on the sent-messages count.

Modified:
    llvm/trunk/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp

Modified: llvm/trunk/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp?rev=371263&r1=371262&r2=371263&view=diff
==============================================================================
--- llvm/trunk/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp (original)
+++ llvm/trunk/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp Fri Sep  6 14:55:43 2019
@@ -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) {




More information about the llvm-commits mailing list