Skip to content
Snippets Groups Projects
Commit 23057a30 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

unit tests: fix race condition

parent dbdd3f8f
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment