Skip to content

Commit 2ac3c32

Browse files
committed
ci(run-tests): improve old DB container cleanup (#678)
Replace `docker stop` with `docker rm -f` when cleaning the old Postgres test container. Stopping a `--rm` container triggers asynchronous removal, so on faster machines the next `docker run --rm` could fire before the old container was gone, leading to a name conflict. `docker rm -f` stops and removes synchronously, so the subsequent `docker run` always succeeds.
1 parent dc8bb22 commit 2ac3c32

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

run-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ clean_old_db_container() {
3232
OLD="$(docker ps --all --quiet --filter=name=postgres__reana-workflow-controller)"
3333
if [ -n "$OLD" ]; then
3434
echo '==> [INFO] Cleaning old DB container...'
35-
docker stop postgres__reana-workflow-controller
35+
docker rm -f postgres__reana-workflow-controller >/dev/null 2>&1 || true
3636
fi
3737
}
3838

0 commit comments

Comments
 (0)