From 50045e71c819749a4a48aad2fdebbe8309388bd6 Mon Sep 17 00:00:00 2001 From: Ian Fijolek Date: Thu, 26 Sep 2024 11:23:20 -0700 Subject: [PATCH] Speed up itest runs Wait only the number of seconds until the next minute, plus 5 for buffer --- itest/itest.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/itest/itest.sh b/itest/itest.sh index 8b62bd1..c8bb4c3 100755 --- a/itest/itest.sh +++ b/itest/itest.sh @@ -17,16 +17,18 @@ function main() { echo "start" > ./exec_result.txt # Clean old containers - docker-compose down || true + docker compose down || true # Start containers echo "Starting containers" - docker-compose up -d --build - echo "Containers started. Sleeping for 70s to let schedules run" + docker compose up -d --build # Schedules run on the shortest interval of a minute. This should allow time # for the containers to start and execute once - sleep 70 + local seconds=$((65 - $(date +"%S"))) + echo "Containers started. Sleeping for ${seconds}s to let schedules run" + sleep $seconds + echo "Stopping containers" - docker-compose stop + docker compose stop # Validate result shows minimum amount of executions check_results ./start_result.txt 2