Skip to content

tests: fix stop race in ITest_AsyncSimTask.test_timestamp_handling - #455

Open
KonradBreitsprecherBkd wants to merge 1 commit into
mainfrom
fix/itest-timestamp-handling-stop-race
Open

KonradBreitsprecherBkd wants to merge 1 commit into
mainfrom
fix/itest-timestamp-handling-stop-race

Conversation

@KonradBreitsprecherBkd

@KonradBreitsprecherBkd KonradBreitsprecherBkd commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

ITest_AsyncSimTask.test_timestamp_handling failed in the nightly run with a 5 s harness timeout on Async2.

The async participants are autonomous, so their lifecycle runs independently of the sync participants. They can receive pub/sub messages before reaching Running. The Sync step handler stopped everyone as soon as all messages arrived. If that happened before Async2 reached Running, its Stop() was dropped as an invalid state transition, and Async2 never finished.

The fix is test-only: stop only once both async participants are Running.

Evidence

The race did not reproduce locally, even with 16 parallel instances. To force it, Async2 was temporarily held in CommunicationInitialized for 200 ms using an async comm-ready handler completed from another thread. This keeps its IO thread free to receive messages before it reaches Running. Each variant ran 5 times.

  • Before: 5/5 failed with the nightly pattern
    After: 5/5 passed. Without the injected delay: 300/300 sequential runs and 16 parallel instances × 40 runs passed.

Merge Danger

This changes only ITest_AsyncSimTask.cpp. No library code is changed.

The async participants are autonomous and can receive messages before
their lifecycle reaches Running. The sync step handler stopped all
participants as soon as all messages were received; a Stop() issued
before Running is dropped as an invalid state transition, so the async
participant never finished and the harness timed out.

Only stop once both async participants are Running, restrict the
virtual-time fallback to the case where messages are still missing,
and issue the stops only once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Konrad Breitsprecher <Konrad.Breitsprecher@vector.com>
@KonradBreitsprecherBkd KonradBreitsprecherBkd added the status: ready for review Complete and waiting for a reviewer. label Nov 13, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: ready for review Complete and waiting for a reviewer.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant