Commit 830e1022 authored by Christian Kuhn's avatar Christian Kuhn Committed by Anja Leichsenring
Browse files

[TASK] bamboo: db dependency loop needs break condition

Functional and acceptance tests need a db up and running.
The according container is started as dependency and a
loop delays further execution until the database connected
to its network port. This sometimes goes wrong, for
instance mssql in rare conditions does not come up. This
leads to the loop running "forever", consuming the
executing bamboo agent and the job never finishs.
The patch adds an additional break condition: If db did
not connect to the port after a minute, the job now fails.

Resolves: #87549
Releases: master, 9.5, 8.7
Change-Id: Idc45f57d9cfd2d390cea6bd5319adaf4158340df
Reviewed-on: https://review.typo3.org/59567


Tested-by: default avatarTYPO3com <noreply@typo3.com>
Reviewed-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
parent 2d3aa427
......@@ -61,12 +61,17 @@ services:
- test
command: >
/bin/sh -c "
echo Waiting for db start...;
while ! nc -z mariadb10 3306;
do
sleep 1;
done;
echo Connected!;
echo Waiting for database start
COUNT=0
while ! nc -z mariadb10 3306; do
if [ "$${COUNT}" -ge "60" ]; then
echo Database did not come up
exit 1
fi
let "COUNT++"
sleep 1
done
echo Database is up
"
start_dependencies_acceptance_install_postgres10:
......@@ -79,12 +84,17 @@ services:
- test
command: >
/bin/sh -c "
echo Waiting for db start...;
while ! nc -z postgres10 5432;
do
sleep 1;
done;
echo Connected!;
echo Waiting for database start
COUNT=0
while ! nc -z postgres10 5432; do
if [ "$${COUNT}" -ge "60" ]; then
echo Database did not come up
exit 1
fi
let "COUNT++"
sleep 1
done
echo Database is up
"
start_dependencies_acceptance_install_sqlite:
......@@ -107,12 +117,17 @@ services:
- test
command: >
/bin/sh -c "
echo Waiting for db start...;
while ! nc -z mariadb10 3306;
do
sleep 1;
done;
echo Connected!;
echo Waiting for database start
COUNT=0
while ! nc -z mariadb10 3306; do
if [ "$${COUNT}" -ge "60" ]; then
echo Database did not come up
exit 1
fi
let "COUNT++"
sleep 1
done
echo Database is up
"
start_dependencies_functional_mariadb10:
......@@ -125,12 +140,17 @@ services:
- test
command: >
/bin/sh -c "
echo Waiting for db start...;
while ! nc -z mariadb10 3306;
do
sleep 1;
done;
echo Connected!;
echo Waiting for database start
COUNT=0
while ! nc -z mariadb10 3306; do
if [ "$${COUNT}" -ge "60" ]; then
echo Database did not come up
exit 1
fi
let "COUNT++"
sleep 1
done
echo Database is up
"
start_dependencies_functional_mssql:
......@@ -143,12 +163,17 @@ services:
- test
command: >
/bin/sh -c "
echo Waiting for db start...;
while ! nc -z mssql2017cu9 1433;
do
sleep 1;
done;
echo Connected!;
echo Waiting for database start
COUNT=0
while ! nc -z mssql2017cu9 1433; do
if [ "$${COUNT}" -ge "60" ]; then
echo Database did not come up
exit 1
fi
let "COUNT++"
sleep 1
done
echo Database is up
"
start_dependencies_functional_postgres10:
......@@ -161,12 +186,17 @@ services:
- test
command: >
/bin/sh -c "
echo Waiting for db start...;
while ! nc -z postgres10 5432;
do
sleep 1;
done;
echo Connected!;
echo Waiting for database start
COUNT=0
while ! nc -z postgres10 5432; do
if [ "$${COUNT}" -ge "60" ]; then
echo Database did not come up
exit 1
fi
let "COUNT++"
sleep 1
done
echo Database is up
"
start_dependencies_functional_sqlite:
image: alpine:3.8
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment