This commit is contained in:
J. Nick Koston 2025-07-17 16:26:38 -10:00
parent 7b4edf77da
commit d4a488f9d2
No known key found for this signature in database
2 changed files with 4 additions and 5 deletions

View File

@ -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:

View File

@ -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, {})