Skip to content

Commit

Permalink
tests: rpc: stop client and server
Browse files Browse the repository at this point in the history
Fixes memory leaks reported by asan.
  • Loading branch information
avikivity committed Apr 27, 2016
1 parent 80b9f03 commit 423ce66
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/rpc_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ with_rpc_env(rpc::resource_limits resource_limits,
auto make_client = [&s] (ipv4_addr addr) {
return test_rpc_proto::client(s.proto, addr, s.lcf.make_new_connection());
};
return test_fn(s.proto, *s.server, make_client);
return test_fn(s.proto, *s.server, make_client).finally([&] {
return s.server->stop();
});
});
}

Expand All @@ -109,6 +111,7 @@ SEASTAR_TEST_CASE(test_rpc_connect) {
});
auto result = sum(c1, 2, 3).get0();
BOOST_REQUIRE_EQUAL(result, 2 + 3);
c1.stop().get();
});
});
}

0 comments on commit 423ce66

Please sign in to comment.