Skip to content

[BUG] OperationHandlersFixtureTest.ListExecutionsReturnsTrackedActionGoal flaky under sanitizers #473

Description

@bburda

Bug report

OperationHandlersFixtureTest.ListExecutionsReturnsTrackedActionGoal (gateway test_operation_handlers) is flaky under AddressSanitizer/ThreadSanitizer runs. It fails intermittently and passes on re-run, so it is a timing flake rather than a real regression.

Steps to reproduce

  1. Run the gateway test suite under the sanitizer-tsan (or sanitizer-asan) CI job, or under heavy parallel load.
  2. Observe test_operation_handlers fail occasionally.

Expected behavior

The test deterministically observes the tracked action goal it created and passes.

Actual behavior

src/ros2_medkit_gateway/test/test_operation_handlers.cpp:481: Failure
  Actual: false
Expected: true
[  FAILED  ] OperationHandlersFixtureTest.ListExecutionsReturnsTrackedActionGoal

Failing job: https://github.com/selfpatch/ros2_medkit/actions/runs/28042302017/job/83011417297
The same job passed on re-run (no code change), confirming the flake.

Environment

  • ros2_medkit version: main
  • ROS 2 distro: Jazzy (TSan job)
  • OS: Ubuntu 24.04

Additional information

Listing a tracked action execution depends on the DDS action client/server handshake completing within the assertion's wait. Under sanitizer slowdown that handshake can land after the check, so the goal is not yet listed and the boolean assertion at line 481 reads false. Fix direction: poll/wait for the tracked goal to appear (deterministic wait) instead of asserting once, mirroring how other timing-sensitive tests were hardened.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions