From 23057a3082a146fc6d2ee48dfd3c94e22ba888d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com> Date: Wed, 25 Jul 2018 11:53:57 -0400 Subject: [PATCH] unit tests: fix race condition --- tests/dhtproxytester.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/dhtproxytester.cpp b/tests/dhtproxytester.cpp index 1f128ef4..5f724549 100644 --- a/tests/dhtproxytester.cpp +++ b/tests/dhtproxytester.cpp @@ -116,10 +116,7 @@ DhtProxyTester::testListen() { // All values dht::Value secondVal {"You're a monster"}; auto secondVal_data = secondVal.data; - nodePeer.put(key, std::move(secondVal), [&](bool) { - done = true; - cv.notify_all(); - }); + nodePeer.put(key, std::move(secondVal)); cv.wait_for(lk, std::chrono::seconds(10), [&]{ return done; }); // Here values should contains 3 values CPPUNIT_ASSERT_EQUAL(static_cast<int>(values.size()), 2); -- GitLab