diff --git a/tests/integration/fixtures/delay_action_cancellation.yaml b/tests/integration/fixtures/delay_action_cancellation.yaml index dfb7ee0929..1ef964509b 100644 --- a/tests/integration/fixtures/delay_action_cancellation.yaml +++ b/tests/integration/fixtures/delay_action_cancellation.yaml @@ -33,7 +33,7 @@ script: - logger.log: format: "Script execution started (run number %d)" args: ['id(delay_completed_count) + 1'] - - delay: 3s + - delay: 150ms - lambda: |- id(delay_completed_count)++; - logger.log: diff --git a/tests/integration/test_automations.py b/tests/integration/test_automations.py index f1466a3d40..9b697cad83 100644 --- a/tests/integration/test_automations.py +++ b/tests/integration/test_automations.py @@ -92,17 +92,16 @@ async def test_delay_action_cancellation( await asyncio.wait_for(script_started_future, timeout=5.0) assert script_started_count == 1, "Script should have started once" - # Wait a bit to ensure the delay is running - await asyncio.sleep(0.5) + # Restart immediately - no sleep needed since we're properly testing cancellation # Restart the script client.execute_service(restart_service, {}) # Wait for restart confirmation - await asyncio.wait_for(script_restarted_future, timeout=5.0) + await asyncio.wait_for(script_restarted_future, timeout=2.0) # Wait for the restarted script to complete its delay - await asyncio.wait_for(delay_completed_future, timeout=5.0) + await asyncio.wait_for(delay_completed_future, timeout=1.0) # Check the final result client.execute_service(check_result_service, {})