From 88cddb7a1c1700b9c57e58e08a24f76bc4dd1d4b Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Fri, 6 Sep 2019 21:55:43 +0000 Subject: [PATCH] [ORC][RPC] Join server thread before checking condition in unit test. Otherwise we have a race on the sent-messages count. llvm-svn: 371263 --- llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp b/llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp index 8e4c5330d90e..2a0ed0772524 100644 --- a/llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp +++ b/llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp @@ -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) {