Skip to content

Commit

Permalink
systems/lcm: Re-enable lcm_interface_system_test
Browse files Browse the repository at this point in the history
The test conditions have been relaxed to account for an (purposeful)
race condition with the transmitter thread.

Testing with --runs_per_test=50 reliably trips the failure on master,
and does not trip the failure after this fix.
  • Loading branch information
jwnimmer-tri committed Apr 2, 2019
1 parent 0e13270 commit 95a6743
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 0 additions & 2 deletions systems/lcm/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,6 @@ drake_cc_library(

drake_cc_googletest(
name = "lcm_interface_system_test",
# TODO(jwnimmer-tri) Re-enable this after fixing the race condition.
tags = ["manual"],
deps = [
":lcm_interface_system",
":lcm_subscriber_system",
Expand Down
5 changes: 5 additions & 0 deletions systems/lcm/test/lcm_interface_system_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ TEST_P(LcmInterfaceSystemTest, AcceptanceTest) {
// still publish and service subscriptions. The LcmSubscriberSystem's
// subscriptions should NOT be called anymore.
simulator.reset();
// Empty the queue of anything that was published subsequent to the final
// simulator.AdvanceTo call, but prior to the simulator.reset call.
drake_lcm->HandleSubscriptions(0);
// Even though the transmit thread is still publishing, nothing else should
// appear at the handlers because there are no more active subscriptions.
int total = 0;
for (int i = 0; i < 100; ++i) {
total += drake_lcm->HandleSubscriptions(1);
Expand Down

0 comments on commit 95a6743

Please sign in to comment.