Permalink
Browse files

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)
  • Loading branch information...
1 parent c436fa3 commit e896953f79bf7d806e9f1198c4c8354dde275497 @Neverlord Neverlord committed Feb 20, 2013
Showing with 7 additions and 9 deletions.
  1. +7 −9 unit_testing/test_remote_actor.cpp
@@ -213,8 +213,9 @@ int client_part(const vector<string_pair>& args) {
forward_to(fwd);
}
);
-
+ // shutdown handshake
send(server, atom("farewell"));
+ receive(on(atom("cu")) >> [] { });
shutdown();
return CPPA_TEST_RESULT();
}
@@ -329,11 +330,7 @@ int main(int argc, char** argv) {
CPPA_PRINT("test group communication via network (inverted setup)");
spawn5_server(remote_client, true);
- self->on_sync_failure([&] {
- CPPA_ERROR("unexpected message: "
- << to_string(self->last_dequeued())
- << endl);
- });
+ self->on_sync_failure(CPPA_UNEXPECTED_MSG_CB());
// test forward_to "over network and back"
CPPA_PRINT("test forwarding over network 'and back'");
@@ -348,9 +345,10 @@ int main(int argc, char** argv) {
);
CPPA_PRINT("wait for a last goodbye");
- receive (
- on(atom("farewell")) >> [] { }
- );
+ receive(on(atom("farewell")) >> [&] {
+ send(remote_client, atom("cu"));
+ CPPA_CHECKPOINT();
+ });
// wait until separate process (in sep. thread) finished execution
if (run_remote_actor) child.join();
shutdown();

0 comments on commit e896953

Please sign in to comment.