mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-09 20:24:02 +00:00
Use monotonic time for query timing (#1070)
To fix intermittent issues with [windows CI](https://github.com/python-kasa/python-kasa/actions/runs/9952477932/job/27493918272?pr=1068). Probably better to use monotonic here anyway. ``` FAILED kasa/tests/test_smartdevice.py::test_update_module_update_delays[L530E(EU)_3.0_1.1.6.json-SMART] - ValueError: Clock moved backwards. Refusing to generate ID. ```
This commit is contained in:
@@ -224,7 +224,7 @@ async def test_update_module_update_delays(
|
||||
|
||||
new_dev = SmartDevice("127.0.0.1", protocol=dev.protocol)
|
||||
await new_dev.update()
|
||||
first_update_time = time.time()
|
||||
first_update_time = time.monotonic()
|
||||
assert new_dev._last_update_time == first_update_time
|
||||
for module in new_dev.modules.values():
|
||||
if module.query():
|
||||
@@ -236,7 +236,7 @@ async def test_update_module_update_delays(
|
||||
seconds += tick
|
||||
freezer.tick(tick)
|
||||
|
||||
now = time.time()
|
||||
now = time.monotonic()
|
||||
await new_dev.update()
|
||||
for module in new_dev.modules.values():
|
||||
mod_delay = module.MINIMUM_UPDATE_INTERVAL_SECS
|
||||
|
Reference in New Issue
Block a user