diff --git a/tests/integration/fixtures/delay_action_cancellation.yaml b/tests/integration/fixtures/delay_action_cancellation.yaml index 0b42f9b12d..e0dd427c2d 100644 --- a/tests/integration/fixtures/delay_action_cancellation.yaml +++ b/tests/integration/fixtures/delay_action_cancellation.yaml @@ -8,7 +8,7 @@ api: then: - logger.log: "Starting first script execution" - script.execute: test_delay_script - - delay: 500ms # Give first script time to start delay + - delay: 250ms # Give first script time to start delay - logger.log: "Restarting script (should cancel first delay)" - script.execute: test_delay_script @@ -20,5 +20,5 @@ script: mode: restart then: - logger.log: "Script started, beginning delay" - - delay: 1s # Long enough that it won't complete before restart + - delay: 500ms # Long enough that it won't complete before restart - logger.log: "Delay completed successfully" diff --git a/tests/integration/test_automations.py b/tests/integration/test_automations.py index 8c9a191f95..c40a5d2bba 100644 --- a/tests/integration/test_automations.py +++ b/tests/integration/test_automations.py @@ -73,7 +73,7 @@ async def test_delay_action_cancellation( await asyncio.wait_for(second_script_started, timeout=5.0) # Wait for potential delay completion - await asyncio.sleep(1.5) # Original delay was 1s + await asyncio.sleep(0.75) # Original delay was 500ms # Check results assert len(script_starts) == 2, ( @@ -86,6 +86,6 @@ async def test_delay_action_cancellation( f"Expected 1 delay completion, got {len(delay_completions)}" ) time_from_second_start = delay_completions[0] - script_starts[1] - assert 0.8 < time_from_second_start < 1.2, ( - f"Delay completed {time_from_second_start:.3f}s after second start, expected ~1s" + assert 0.4 < time_from_second_start < 0.6, ( + f"Delay completed {time_from_second_start:.3f}s after second start, expected ~0.5s" )