Skip to content

Commit 38566c2

Browse files
fix: fixed test_orchestrator_rates.
1 parent 8f99647 commit 38566c2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/test_orchestrator_rates.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22
from dummysensors.orchestrator import run_stream
33
from .utils import Capture
4+
import math
45

56
def test_per_sensor_rate_hz_controls_sampling_frequency():
67
cap = Capture()
@@ -16,7 +17,7 @@ def test_per_sensor_rate_hz_controls_sampling_frequency():
1617
spec_str="device=A: temp*1,vibration*1",
1718
rate_hz=10.0, # global tick
1819
duration_s=None,
19-
total_count=20, # ~2.0s
20+
total_count=60, # ~6.0s
2021
writer_for_type={"*": cap.router({"*": cap.writer_for_type("*")})},
2122
partition_by="none",
2223
devices_cfg=devices_cfg,
@@ -33,5 +34,5 @@ def test_per_sensor_rate_hz_controls_sampling_frequency():
3334

3435
# Expect significantly more vibration samples (10 Hz) than temperature (5 Hz).
3536
# Leave tolerance for CI timing jitter: require at least 1.5× more vib or +3 samples.
36-
assert n_vib >= max(int(1.5 * n_temp), n_temp + 3), \
37+
assert n_vib >= max(math.ceil(4/3 * n_temp), n_temp + 3), \
3738
f"expected clearly more vib samples than temp; got temp={n_temp}, vib={n_vib}"

0 commit comments

Comments
 (0)