Skip to content

Commit

Permalink
fix: Add intermediate sleep to prevent race conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
PROFeNoM committed Jan 31, 2024
1 parent eabcc94 commit 819521f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tests/randomized/lib/run-base-docker-compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ while true; do
if [[ ${1:-} == shutdown ]]; then
# check for running tests; in that case don't shutdown
if ! docker network ls | grep -q randomized-; then
sleep 10
sleep 3
# prevent race conditions
if ! docker network ls | grep -q randomized-; then
docker-compose down
Expand Down
4 changes: 4 additions & 0 deletions tests/randomized/lib/templates/Makefile.scenario.template
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ SCENARIO := {{scenario_name}}

run: prepare_results_folders
@SCENARIO=$(SCENARIO) bash ../../lib/run-base-docker-compose.sh
sleep 1
@DURATION=$(DURATION) docker-compose up php-test-$(SCENARIO)
sleep 1
@docker-compose down
sleep 1
@SCENARIO=$(SCENARIO) bash ../../lib/run-base-docker-compose.sh shutdown
sleep 1

shell: prepare_results_folders
@SCENARIO=$(SCENARIO) bash ../../lib/run-base-docker-compose.sh
Expand Down

0 comments on commit 819521f

Please sign in to comment.