Skip to content

LRS-1181: Make TF tests robust to split /tf_static publishing - #3535

Merged
Nir-Az merged 2 commits into
realsenseai:ros2-developmentfrom
Nir-Az:fix-tf-static-test-race
Jul 2, 2026
Merged

Nir-Az merged 2 commits into
realsenseai:ros2-developmentfrom
Nir-Az:fix-tf-static-test-race

Conversation

@Nir-Az

@Nir-Az Nir-Az commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Overview: Fixes the intermittently-failing test_camera_test_tf_dyn and test_camera_test_tf_prefix ("didn't get any tf data"), tracked in LRS-1181.

Root cause

/tf_static is a latched topic, and the node resets its static broadcaster on (re)publish (tfs.cpp: restartStaticTransformBroadcaster), so a subscriber can capture a partial first message. The tests used pop_first_chunk('/tf_static') and validated only that single message in isolation (can_transform, 3 ms) — so when the first captured message didn't contain the link→depth_frame edge, the lookup returned nothing. It's timing-dependent, hence flaky under CI load. The dynamic /tf checks were unaffected because each /tf message republishes the full set.

Fix (test-only)

Added check_static_transform_data() to the test base class, which aggregates the transforms from all received /tf_static messages into one buffer before checking. The two affected tests now use it; /tf checks are unchanged.

Validation

Built and ran on the ROS 2 Humble CI job — the fix branch passed the TF tests on 3 consecutive runs (14/0/5), while the unfixed ros2-development baseline failed the same test in between.

Files: test/utils/pytest_rs_utils.py (+helper), test/live_camera/test_camera_tf_tests.py (two process_data methods). +19/−6.

🤖 Generated by AI

@Nir-Az
Nir-Az merged commit 62189c5 into realsenseai:ros2-development Jul 2, 2026
11 of 12 checks passed
@Nir-Az
Nir-Az deleted the fix-tf-static-test-race branch July 2, 2026 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant