Repository navigation
tests: fix stop race in ITest_AsyncSimTask.test_timestamp_handling - #455
Open
KonradBreitsprecherBkd wants to merge 1 commit into
Open
KonradBreitsprecherBkd wants to merge 1 commit into
KonradBreitsprecherBkd wants to merge 1 commit into
Conversation
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>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ITest_AsyncSimTask.test_timestamp_handlingfailed in the nightly run with a 5 s harness timeout onAsync2.The async participants are autonomous, so their lifecycle runs independently of the sync participants. They can receive pub/sub messages before reaching
Running. TheSyncstep handler stopped everyone as soon as all messages arrived. If that happened beforeAsync2reachedRunning, itsStop()was dropped as an invalid state transition, andAsync2never 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,
Async2was temporarily held inCommunicationInitializedfor 200 ms using an async comm-ready handler completed from another thread. This keeps its IO thread free to receive messages before it reachesRunning. Each variant ran 5 times.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.