Add first version of message passing and rpc
Reviewers: mtomic, buda Reviewed By: mtomic, buda Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D1002
This commit is contained in:
@@ -79,6 +79,7 @@ TEST(Queue, AwaitPop) {
|
||||
});
|
||||
|
||||
EXPECT_EQ(*q.AwaitPop(), 1);
|
||||
std::this_thread::sleep_for(1000ms);
|
||||
EXPECT_EQ(*q.AwaitPop(), 2);
|
||||
EXPECT_EQ(*q.AwaitPop(), 3);
|
||||
EXPECT_EQ(*q.AwaitPop(), 4);
|
||||
@@ -86,12 +87,19 @@ TEST(Queue, AwaitPop) {
|
||||
|
||||
std::thread t2([&] {
|
||||
std::this_thread::sleep_for(100ms);
|
||||
q.Signal();
|
||||
q.Shutdown();
|
||||
});
|
||||
std::this_thread::sleep_for(200ms);
|
||||
EXPECT_EQ(q.AwaitPop(), std::experimental::nullopt);
|
||||
t2.join();
|
||||
}
|
||||
|
||||
TEST(Queue, AwaitPopTimeout) {
|
||||
std::this_thread::sleep_for(1000ms);
|
||||
Queue<int> q;
|
||||
EXPECT_EQ(q.AwaitPop(100ms), std::experimental::nullopt);
|
||||
}
|
||||
|
||||
TEST(Queue, Concurrent) {
|
||||
Queue<int> q;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user