Skip to content

Commit

Permalink
Merge pull request #1023 from nejch/perf/wait-gitlab-reconfigure
Browse files Browse the repository at this point in the history
perf: wait for gitlab to reconfigure instead of using hardcoded sleep
  • Loading branch information
max-wittig committed Feb 24, 2020
2 parents f071390 + 3834d9c commit 2b3871d
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions tools/build_test_env.sh
Expand Up @@ -141,20 +141,13 @@ while :; do
sleep 1
docker top gitlab-test >/dev/null 2>&1 || fatal "docker failed to start"
sleep 4
# last command started by the container is "gitlab-ctl tail"
docker exec gitlab-test pgrep -f 'gitlab-ctl tail' &>/dev/null \
&& docker exec gitlab-test curl http://localhost/-/health 2>/dev/null \
| grep -q 'GitLab OK' \
&& curl -s http://localhost:8080/users/sign_in 2>/dev/null \
| grep -q "GitLab Community Edition" \
docker logs gitlab-test 2>&1 | grep "gitlab Reconfigured!" \
&& break
I=$((I+5))
log "Waiting for GitLab to reconfigure.. (${I}s)"
[ "$I" -lt 180 ] || fatal "timed out"
done

log "Pausing to give GitLab some time to finish starting up..."
sleep 200

# Get the token
TOKEN=$($(dirname $0)/generate_token.py)

Expand Down

0 comments on commit 2b3871d

Please sign in to comment.