File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -546,6 +546,17 @@ test_redis_server_persistence_with_bind_mount() {
546546
547547 container=$( docker run --rm -d -v " $( pwd) /$dir " :/data " $REDIS_IMG " --appendonly yes)
548548
549+ # Add debug output to see if container started properly
550+ echo " Container status:"
551+ docker ps -a | grep " $container "
552+
553+ # Check container logs if it's not running
554+ if ! docker ps | grep -q " $container " ; then
555+ echo " Container failed to start. Logs:"
556+ docker logs " $container "
557+ return 1
558+ fi
559+
549560 result=$( echo save | docker exec -i " $container " redis-cli)
550561 assertEquals " OK" " $result "
551562
@@ -568,8 +579,14 @@ test_redis_server_persistence_with_bind_mount() {
568579}
569580
570581test_redis_server_persistence_with_volume () {
582+ # Ensure volume is removed at the start
571583 docker volume rm test_redis > /dev/null 2>&1 || :
572584
585+ # Make sure no containers are using the volume
586+ for cid in $( docker ps -a -q --filter volume=test_redis) ; do
587+ docker rm -f " $cid " > /dev/null 2>&1 || :
588+ done
589+
573590 docker volume create test_redis > /dev/null
574591
575592 # change owner of the data volume
You can’t perform that action at this time.
0 commit comments