Skip to content

Add Time Coordinator Integrationtests#375

Closed
KonradBreitsprecherBkd wants to merge 1 commit into
mainfrom
dev/acceptance-test-central-coordinator
Closed

Add Time Coordinator Integrationtests#375
KonradBreitsprecherBkd wants to merge 1 commit into
mainfrom
dev/acceptance-test-central-coordinator

Conversation

@KonradBreitsprecherBkd

@KonradBreitsprecherBkd KonradBreitsprecherBkd commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Goal

Enable deterministic, runtime step-size adjustments in coordinated simulation so the new integration tests in SilKit/IntegrationTests/ITest_TimeCoordinator.cpp pass:

  • test_fixed_schedule_slowdown_by_time_coordinator
  • test_fixed_schedule_slowdown_by_participant

Functional Requirements

1. Time Coordinator creation API

  • Provide an API to create a Time Coordinator Service.
    • One approach could be to add a flag in the call to CreateTimeSyncService.
    • Another way is to enable creation only via the participant configuration
  • There must be only one Time Coordinator in the simulation. This can be assured with the following pattern:
    • Add a flag to the ServiceDescriptor of the timeSyncService indicating that the participant is a TimeCoordinator
    • After lifecycleService->Start(), the supplementalData of the timeSyncService is distributed.
    • The existing barrier in the transition of lifecylce states ServiceCreated to CommunicationInitializing ensures that
      the supplementalData of all participants has arrived when in the CommunicationInitializing state.
    • Now the check if there is more than one Time Coordinator can be be carried out race-free.

2. Runtime step-size change API

  • Provide an API on time synchronization service to request a new simulation step size at runtime (as referenced in tests):
    • SetStepSize(std::chrono::nanoseconds)
    • This must be callable from within a simulation step handler.
  • Alternatively, the stepSize could be changed through the existing API by calling SetSimulationStepHandler.

4. Global schedule effect

  • A step-size change requested by one coordinated participant must affect the global coordinated schedule (not only the caller).
  • This must work for:
    • a dedicated coordinator participant (TimeCoordinator), and
    • a regular participant (Publisher).

5. Fixed slowdown sequence support

For the cycle around 10ms, the following requested sequence must be supported:

  1. At 10ms, set step size to 1us
  2. At 10ms + 1us, set step size to 999us
  3. At 11ms, set step size back to 1ms

The resulting simulation-step timestamps for all coordinated participants must include:

  • 0ms, 1ms, 2ms, ..., 10ms, 10ms+1us, 11ms, 12ms

4. Pub/Sub timing expectation

  • A message published at simulation time 10ms must be received and visible by 10ms+1us.
  • The tests validate this via subscriber bookkeeping in its simulation step handler.

Determinism / Consistency Requirements

  • All coordinated participants must observe the same global step timeline for the slowdown window.
  • No participant may skip the inserted 10ms+1us step when slowdown is active.

Compatibility Requirements

  • Existing coordinated simulations without SetStepSize(...) calls must preserve current behavior.
  • A capability check should be in place and warn if a participant is not supporting the Time Coordinator feature when it's in use

Signed-off-by: Konrad Breitsprecher <Konrad.Breitsprecher@vector.com>
@KonradBreitsprecherBkd KonradBreitsprecherBkd changed the title Add initial timecoordinator Itests Add Time Coordinator Integrationtests Jun 26, 2026
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