Skip to content

Commit dca23fe

Browse files
keep the event alive throught the assertion, preveiting the race. (#3099) (#3101)
(cherry picked from commit aadcb3b) Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com> Co-authored-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
1 parent 3a053fb commit dca23fe

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

rclcpp/test/rclcpp/node_interfaces/test_node_graph.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ TEST_F(TestNodeGraph, construct_from_node)
131131
EXPECT_NE(nullptr, node_graph()->get_graph_guard_condition());
132132

133133
// get_graph_event is non-const
134-
EXPECT_NE(nullptr, node()->get_node_graph_interface()->get_graph_event());
134+
auto event = node()->get_node_graph_interface()->get_graph_event();
135+
EXPECT_NE(nullptr, event);
135136
EXPECT_LE(1u, node_graph()->count_graph_users());
136137
}
137138

0 commit comments

Comments
 (0)