Skip to content

Commit 85c32a9

Browse files
authored
Make the test of graph users more robust. (#1504)
In particular, we don't know for sure that the graph will only have 1 user; we just know that it should have *at least* one user. So change that check to be more robust. This also lets us get rid of the slightly strange call to 'notify_graph_change' that was being used to cleanup graph users. Signed-off-by: Chris Lalancette <[email protected]>
1 parent 5821361 commit 85c32a9

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

rclcpp/test/rclcpp/node_interfaces/test_node_graph.cpp

+1-5
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,6 @@ class TestNodeGraph : public ::testing::Test
8484
EXPECT_NO_THROW(node()->wait_for_graph_change(event, timeout));
8585
}
8686

87-
// Run notify_graph_change() here to remove the graph_event users we created
88-
// in the loop above.
89-
node_graph_->notify_graph_change();
90-
9187
return num_things;
9288
}
9389

@@ -132,7 +128,7 @@ TEST_F(TestNodeGraph, construct_from_node)
132128

133129
// get_graph_event is non-const
134130
EXPECT_NE(nullptr, node()->get_node_graph_interface()->get_graph_event());
135-
EXPECT_EQ(1u, node_graph()->count_graph_users());
131+
EXPECT_LE(1u, node_graph()->count_graph_users());
136132
}
137133

138134
TEST_F(TestNodeGraph, get_topic_names_and_types)

0 commit comments

Comments
 (0)