Commit e896953f authored by Dominik Charousset's avatar Dominik Charousset

added shutdown handshake to test_remote_actor

the added shutdown handshake fixes a possible unit test failure
(remote actor calls `shutdown` before final message was sent)
parent c436fa39
...@@ -213,8 +213,9 @@ int client_part(const vector<string_pair>& args) { ...@@ -213,8 +213,9 @@ int client_part(const vector<string_pair>& args) {
forward_to(fwd); forward_to(fwd);
} }
); );
// shutdown handshake
send(server, atom("farewell")); send(server, atom("farewell"));
receive(on(atom("cu")) >> [] { });
shutdown(); shutdown();
return CPPA_TEST_RESULT(); return CPPA_TEST_RESULT();
} }
...@@ -329,11 +330,7 @@ int main(int argc, char** argv) { ...@@ -329,11 +330,7 @@ int main(int argc, char** argv) {
CPPA_PRINT("test group communication via network (inverted setup)"); CPPA_PRINT("test group communication via network (inverted setup)");
spawn5_server(remote_client, true); spawn5_server(remote_client, true);
self->on_sync_failure([&] { self->on_sync_failure(CPPA_UNEXPECTED_MSG_CB());
CPPA_ERROR("unexpected message: "
<< to_string(self->last_dequeued())
<< endl);
});
// test forward_to "over network and back" // test forward_to "over network and back"
CPPA_PRINT("test forwarding over network 'and back'"); CPPA_PRINT("test forwarding over network 'and back'");
...@@ -348,9 +345,10 @@ int main(int argc, char** argv) { ...@@ -348,9 +345,10 @@ int main(int argc, char** argv) {
); );
CPPA_PRINT("wait for a last goodbye"); CPPA_PRINT("wait for a last goodbye");
receive ( receive(on(atom("farewell")) >> [&] {
on(atom("farewell")) >> [] { } send(remote_client, atom("cu"));
); CPPA_CHECKPOINT();
});
// wait until separate process (in sep. thread) finished execution // wait until separate process (in sep. thread) finished execution
if (run_remote_actor) child.join(); if (run_remote_actor) child.join();
shutdown(); shutdown();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment