Skip to content

Commit 2b3871d

Browse files
authored
Merge pull request #1023 from nejch/perf/wait-gitlab-reconfigure
perf: wait for gitlab to reconfigure instead of using hardcoded sleep
2 parents f071390 + 3834d9c commit 2b3871d

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

tools/build_test_env.sh

+2-9
Original file line numberDiff line numberDiff line change
@@ -141,20 +141,13 @@ while :; do
141141
sleep 1
142142
docker top gitlab-test >/dev/null 2>&1 || fatal "docker failed to start"
143143
sleep 4
144-
# last command started by the container is "gitlab-ctl tail"
145-
docker exec gitlab-test pgrep -f 'gitlab-ctl tail' &>/dev/null \
146-
&& docker exec gitlab-test curl http://localhost/-/health 2>/dev/null \
147-
| grep -q 'GitLab OK' \
148-
&& curl -s http://localhost:8080/users/sign_in 2>/dev/null \
149-
| grep -q "GitLab Community Edition" \
144+
docker logs gitlab-test 2>&1 | grep "gitlab Reconfigured!" \
150145
&& break
151146
I=$((I+5))
147+
log "Waiting for GitLab to reconfigure.. (${I}s)"
152148
[ "$I" -lt 180 ] || fatal "timed out"
153149
done
154150

155-
log "Pausing to give GitLab some time to finish starting up..."
156-
sleep 200
157-
158151
# Get the token
159152
TOKEN=$($(dirname $0)/generate_token.py)
160153

0 commit comments

Comments
 (0)