Quellcode durchsuchen

Dump docker logs on after max connection retries

Mike Dillon vor 10 Jahren
Ursprung
Commit
86d3922345

+ 2 - 1
test/tests/jetty-hello-web/run.sh

@@ -33,7 +33,8 @@ while [ "$tried" -ge 0 -a "$(_request GET / --output /dev/null || echo $?)" = 7
 
 	if [ "$tried" -le 0 ]; then
 		echo >&2 "Unable to connect to Jetty. Aborting."
-		exit 1
+		( set -x && docker logs "$cid" ) >&2 || true
+		false
 	fi
 
 	echo >&2 -n .

+ 1 - 0
test/tests/mongo-basics/run.sh

@@ -20,6 +20,7 @@ while ! mongo_eval 'quit(db.stats().ok ? 0 : 1);' &> /dev/null; do
 	(( tries-- ))
 	if [ $tries -le 0 ]; then
 		echo >&2 'mongod failed to accept connections in a reasonable amount of time!'
+		( set -x && docker logs "$cid" ) >&2 || true
 		mongo --eval 'db.stats();' # to hopefully get a useful error message
 		false
 	fi

+ 1 - 0
test/tests/postgres-basics/run.sh

@@ -32,6 +32,7 @@ while ! echo 'SELECT 1' | psql &> /dev/null; do
 	(( tries-- ))
 	if [ $tries -le 0 ]; then
 		echo >&2 'postgres failed to accept connections in a reasonable amount of time!'
+		( set -x && docker logs "$cid" ) >&2 || true
 		echo 'SELECT 1' | psql # to hopefully get a useful error message
 		false
 	fi

+ 1 - 0
test/tests/postgres-initdb/run.sh

@@ -41,6 +41,7 @@ while ! echo 'SELECT 1' | psql &> /dev/null; do
 	(( tries-- ))
 	if [ $tries -le 0 ]; then
 		echo >&2 'postgres failed to accept connections in a reasonable amount of time!'
+		( set -x && docker logs "$cid" ) >&2 || true
 		echo 'SELECT 1' | psql # to hopefully get a useful error message
 		false
 	fi