Skip to content

Commit

Permalink
fix flaky test (ros2#1063)
Browse files Browse the repository at this point in the history
* fix flaky test

Signed-off-by: Chen Lihui <lihui.chen@sony.com>

* avoid RCL_RET_NODE_NAME_NON_EXISTENT case instead of removing ASSERT

Co-authored-by: Tomoya.Fujita <Tomoya.Fujita@sony.com>
Signed-off-by: Chen Lihui <lihui.chen@sony.com>

* return immediately

Signed-off-by: Chen Lihui <lihui.chen@sony.com>

* set the out parameter

Signed-off-by: Chen Lihui <lihui.chen@sony.com>

* Revert "set the out parameter"

This reverts commit a1f3c0d.

Signed-off-by: Chen Lihui <lihui.chen@sony.com>

* Revert "return immediately"

This reverts commit 1c83504.

Signed-off-by: Chen Lihui <lihui.chen@sony.com>

---------

Signed-off-by: Chen Lihui <lihui.chen@sony.com>
Co-authored-by: Tomoya.Fujita <Tomoya.Fujita@sony.com>
  • Loading branch information
2 people authored and danthony06 committed Jun 14, 2023
1 parent 1fa6461 commit 5e0cd1a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rcl/test/rcl/test_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,11 @@ void expect_topics_types(
rcl_names_and_types_t nat{};
nat = rcl_get_zero_initialized_names_and_types();
ret = func(node, topic_name, &nat);
ASSERT_EQ(RCL_RET_OK, ret) << rcl_get_error_string().str;
// Ignore the `RCL_RET_NODE_NAME_NON_EXISTENT` result since the discovery may be asynchronous
// that the node information is not updated immediately into the graph cache.
if (ret != RCL_RET_NODE_NAME_NON_EXISTENT) {
ASSERT_EQ(RCL_RET_OK, ret) << rcl_get_error_string().str;
}
rcl_reset_error();
is_success &= num_topics == nat.names.size;
if (expect) {
Expand Down

0 comments on commit 5e0cd1a

Please sign in to comment.