← Back to Pull requests

Fix a race between test_ping and test_pong. #278

Closed
unknown closed this pull request without merging on Nov 17, 2026 22:38 UTC
View on GitHub
unknown unknown commented on Nov 16, 2026 21:30 UTC
Author

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

Diff: 199 lines (+149 / -50) across 2 files Reviewer: mjcarroll Review duration: 1508m
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
0.36
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
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
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 36.1% (MEDIUM) · Higher = larger blast radius
36.1%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 14.3% · Safe to merge
14.3%