From 761cdf8f50ad57523c2e615e9708a839c9a34ebc 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371263 91177308-0d34-0410-b5e6-96231b3b80d8 --- unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp b/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp index 8e4c5330d90..2a0ed077252 100644 --- a/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp +++ b/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) { -- 2.50.1