Fix a race between test_ping and test_pong. #278
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 199 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.317
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #278"
general
weight: 0.35
mjcarroll
Description
By default, test_ping publishes a single transient_local ping and waits for a pong, and test_pong replies once and exits. The pong publisher is volatile, so if test_ping's subscription has not been matched yet when test_pong replies, or if test_pong exits before the reply is delivered, test_ping waits forever. Anything that launches the nodes in their default mode then hangs, which was seen with test_tracetools_launch on nightly_linux-aarch64_release #3745.
Make test_pong wait until test_ping's subscription is matched before replying, and then stay alive until test_ping has gone away. This keeps the exchange to exactly one message in each direction.
So that neither node can wait forever if something still goes wrong, bound test_pong's wait for a match to 10 seconds, and in the default mode, give each node 30 seconds to finish the exchange. Either way, the node logs an error and exits with a non-zero exit code.
Since test_pong now keeps spinning after replying, some middlewares report an rmw_take that does not take anything (e.g., when the publisher goes away), so only consider takes that actually took a message in test_pub_sub.
Is this user-facing behavior change?
No.
Did you use Generative AI?
Yes, Claude Opus 5.5
Additional Information
This should fix the hang that we saw in https://ci.ros2.org/view/nightly/job/nightly_linux-aarch64_release/3745 , and will likely allow us to unskip the tests in https://github.com/ros2/ros2_tracing/blob/d435a24cf3210229ad5e11834d1ae6a3df652170/test_ros2trace/test/test_ros2trace/test_trace.py#L77