Merge pull request #1400 from nextcloud/fix-mysql-racecondition
add actual check if mysql is up already
This commit is contained in:
commit
630b2ff01d
|
@ -127,7 +127,6 @@ pipeline:
|
||||||
mysql-php5.6:
|
mysql-php5.6:
|
||||||
image: nextcloudci/php5.6:php5.6-2
|
image: nextcloudci/php5.6:php5.6-2
|
||||||
commands:
|
commands:
|
||||||
- sleep 15 # gives the database enough time to initialize
|
|
||||||
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mysql
|
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mysql
|
||||||
when:
|
when:
|
||||||
matrix:
|
matrix:
|
||||||
|
|
13
autotest.sh
13
autotest.sh
|
@ -191,14 +191,6 @@ function execute_tests {
|
||||||
-d mysql)
|
-d mysql)
|
||||||
DATABASEHOST=$(docker inspect --format="{{.NetworkSettings.IPAddress}}" "$DOCKER_CONTAINER_ID")
|
DATABASEHOST=$(docker inspect --format="{{.NetworkSettings.IPAddress}}" "$DOCKER_CONTAINER_ID")
|
||||||
|
|
||||||
echo "Waiting for MySQL initialisation ..."
|
|
||||||
if ! apps/files_external/tests/env/wait-for-connection $DATABASEHOST 3306 600; then
|
|
||||||
echo "[ERROR] Waited 600 seconds, no response" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "MySQL is up."
|
|
||||||
|
|
||||||
else
|
else
|
||||||
if [ -z "$DRONE" ] ; then # no need to drop the DB when we are on CI
|
if [ -z "$DRONE" ] ; then # no need to drop the DB when we are on CI
|
||||||
if [ "mysql" != "$(mysql --version | grep -o mysql)" ] ; then
|
if [ "mysql" != "$(mysql --version | grep -o mysql)" ] ; then
|
||||||
|
@ -211,6 +203,11 @@ function execute_tests {
|
||||||
DATABASEHOST=127.0.0.1
|
DATABASEHOST=127.0.0.1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
echo "Waiting for MySQL initialisation ..."
|
||||||
|
if ! apps/files_external/tests/env/wait-for-connection $DATABASEHOST 3306 600; then
|
||||||
|
echo "[ERROR] Waited 600 seconds, no response" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
if [ "$DB" == "mariadb" ] ; then
|
if [ "$DB" == "mariadb" ] ; then
|
||||||
if [ ! -z "$USEDOCKER" ] ; then
|
if [ ! -z "$USEDOCKER" ] ; then
|
||||||
|
|
Loading…
Reference in New Issue