Skip to content

Commit

Permalink
tests: kernel: timer: behavior: pytest: Adjust max stddev
Browse files Browse the repository at this point in the history
Like in C test. If MAX STDDEV is lower than single clock cycle then
set it to a single clock cycle.

Signed-off-by: Krzysztof Chruściński <[email protected]>
  • Loading branch information
nordic-krch committed Jun 26, 2024
1 parent 72bae8f commit ebc0a71
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/kernel/timer/timer_behavior/pytest/test_timer.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ def do_analysis(test, stats, stats_count, config, sys_clock_hw_cycles_per_sec):
max_bound = (test_period + period_max_drift * test_period +
expected_period_drift) / 1_000_000

cyc_us = 1000000 / sys_clock_hw_cycles_per_sec
max_stddev = int(config['TIMER_TEST_MAX_STDDEV']) / 1_000_000
# Max STDDEV cannot be lower than clock single cycle
max_stddev = max(cyc_us, max_stddev)

max_drift_ppm = int(config['TIMER_EXTERNAL_TEST_MAX_DRIFT_PPM'])
time_diff = stats['total_time'] - seconds - expected_total_drift
Expand Down

0 comments on commit ebc0a71

Please sign in to comment.