Skip to content

Bug: Cyclic program runs faster than cyclic time #53

@PiotrKorkus

Description

@PiotrKorkus

Original report: https://github.com/qorix-group/inc_orchestrator_internal/issues/405

Describe the bug:

Assuming we run program with run_n(10) and cyclic_event is set to 10ms we expect that this program should run for at least 100ms.
We count time between execution of start action and beginning of the sleep in stop action.

    design.add_program("test", move |design, builder| {
        builder
            .with_start_action(JustLogAction::new("Start"))
            .with_run_action(
                SequenceBuilder::new()
                    .with_step(SyncBuilder::from_design("cyclic_event", design))
                    .with_step(JustLogAction::new("RunAction"))
                    .build(),
            )
            .with_stop_action(Invoke::from_tag(&stop_tag, design.config()), std::time::Duration::from_secs(10));

        Ok(())
    });

Steps to reproduce the behavior:

  1. git switch piotrkorkus_timerevents_tests
  2. cd component_integration_tests/rust_test_scenarios
  3. cargo run -- --name basic.cyclic --input '{"runtime": {"task_queue_size": 256, "workers": 4}, "test": {"cycle_duration_ms": 10, "design_name": "sleep_after_cyclic_in_sequence", "run_count": 10}}'

Observed behavior:

Calculated time between start and beginning of the stop action is 97ms.

Expected behavior

Calculated time between start and beginning of the stop action is at least 100ms.

Occurrence:

Sporadic (very rare locally, sometimes in CICD)

Attachments / Logs:

https://github.com/qorix-group/inc_orchestrator_internal/actions/runs/19702125030/job/56440677007?pr=401

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions