From be1889e476f85e5abf4bff9ee59e28ba04da7985 Mon Sep 17 00:00:00 2001 From: William Emfinger Date: Thu, 26 Nov 2026 16:14:13 -0700 Subject: [PATCH] test(rtps): give action_goal_flood's get_result room before goals retire Step 3 cancels the three goals and asks get_result for one of them right away, expecting CANCELED. The server retires a finished goal result_timeout after it terminated, and the test set that to 300 ms, so a get_result that reached the server later than that (a loaded CI runner, a retransmitted request) found the goal already retired and got UNKNOWN. The Humble interop job failed that way once. Use a 2 s result_timeout, wait 3 s before step 4 checks that the goal was retired, and print the status get_result returned when step 3 fails. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01DFjjnq3XCTRAXENSxsCxJU --- pc/tests/rtps_action_goal_flood.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/pc/tests/rtps_action_goal_flood.cpp b/pc/tests/rtps_action_goal_flood.cpp index 5d915868a3..6120fe83f5 100644 --- a/pc/tests/rtps_action_goal_flood.cpp +++ b/pc/tests/rtps_action_goal_flood.cpp @@ -17,8 +17,8 @@ // 2. An accepted id sent again is rejected. // 3. Cancel-all (a zero id): the 3 goals are listed, finish CANCELED, and // get_result says so right away. -// 4. With result_timeout 300 ms, get_result a second later is UNKNOWN, and -// the server accepts goals again. +// 4. With result_timeout 2 s, get_result 3 s later is UNKNOWN, and the +// server accepts goals again. // // Exits 0 on success, 1 on failure. @@ -72,7 +72,10 @@ bool run() { {.action = kAction, .type_name = kType, .max_goals_in_flight = 3, - .result_timeout = 300ms}, + // long enough that step 3's get_result reaches the server before + // the goals are retired, also on a loaded CI runner (with 300 ms + // the Humble interop job once got UNKNOWN there) + .result_timeout = 2s}, [](const Rtps::GoalId &, std::span) { return true; }, [&executing](Rtps::ActionGoalHandle h) { executing.fetch_add(1); @@ -144,11 +147,14 @@ bool run() { ract::GoalStatus status{}; std::vector result; CHECK(reply && ract::unwrap_get_result_response(*reply, status, result), "get_result answered"); + if (status != ract::GoalStatus::CANCELED) { + std::printf("get_result status: %d\n", static_cast(status)); + } CHECK(status == ract::GoalStatus::CANCELED, "get_result right after: CANCELED"); } // 4. Past result_timeout the goal is retired; the server has room again. - std::this_thread::sleep_for(1s); + std::this_thread::sleep_for(3s); { const auto reply = get_result->call(ract::make_get_result_request(ids.front()), 5s); ract::GoalStatus status{};