From ca2755ed6af0279b203da12e09bc4094af3aa49b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Thu, 11 Feb 2016 11:09:03 +0100 Subject: [PATCH 1/2] Wait until mariadb is up and running --- autotest.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/autotest.sh b/autotest.sh index 5196d5c31d..f4c70f99b8 100755 --- a/autotest.sh +++ b/autotest.sh @@ -193,9 +193,10 @@ function execute_tests { DATABASEHOST=$(docker inspect --format="{{.NetworkSettings.IPAddress}}" "$DOCKER_CONTAINER_ID") echo "Waiting for MariaDB initialisation ..." - - # grep exits on the first match and then the script continues - timeout 30 docker logs -f $DOCKER_CONTAINER_ID 2>&1 | grep -q "mysqld: ready for connections." + if ! apps/files_external/tests/env/wait-for-connection $DATABASEHOST 3306 60; then + echo "[ERROR] Waited 60 seconds, no response" >&2 + exit 1 + fi echo "MariaDB is up." From 6b635044a721c5ccf63a6e20165ed7d775fafaa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Thu, 11 Feb 2016 14:11:41 +0100 Subject: [PATCH 2/2] Use official mariadb docker --- autotest.sh | 3 ++- tests/docker/mariadb/oc.cnf | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 tests/docker/mariadb/oc.cnf diff --git a/autotest.sh b/autotest.sh index f4c70f99b8..48b7328349 100755 --- a/autotest.sh +++ b/autotest.sh @@ -185,11 +185,12 @@ function execute_tests { if [ ! -z "$USEDOCKER" ] ; then echo "Fire up the mariadb docker" DOCKER_CONTAINER_ID=$(docker run \ + -v $BASEDIR/tests/docker/mariadb:/etc/mysql/conf.d \ -e MYSQL_ROOT_PASSWORD=owncloud \ -e MYSQL_USER="$DATABASEUSER" \ -e MYSQL_PASSWORD=owncloud \ -e MYSQL_DATABASE="$DATABASENAME" \ - -d rullzer/mariadb-owncloud) + -d mariadb) DATABASEHOST=$(docker inspect --format="{{.NetworkSettings.IPAddress}}" "$DOCKER_CONTAINER_ID") echo "Waiting for MariaDB initialisation ..." diff --git a/tests/docker/mariadb/oc.cnf b/tests/docker/mariadb/oc.cnf new file mode 100644 index 0000000000..590284d461 --- /dev/null +++ b/tests/docker/mariadb/oc.cnf @@ -0,0 +1,5 @@ + +[mysqld] + +innodb_buffer_pool_size = 512M +innodb_flush_log_at_trx_commit = 2