Skip to content

Commit 7619d69

Browse files
authored
Merge pull request moby#3451 from vangarp/vangarp/azblob-test-harden
Flakiness in azblob test job
2 parents 617b78c + aa06876 commit 7619d69

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

hack/azblob_test/test.sh

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,19 @@ BLOB_PORT=10000
99
azurite --silent --location /tmp/azurite --debug /tmp/azurite/azurite.debug --blobPort ${BLOB_PORT} &
1010
timeout 15 bash -c "until echo > /dev/tcp/localhost/${BLOB_PORT}; do sleep 0.5; done"
1111

12-
buildkitd -debugaddr 0.0.0.0:8060 &
13-
while true; do
14-
curl -s -f http://127.0.0.1:8060/debug/pprof/ >/dev/null && break
15-
sleep 1
12+
# Start buildkitd
13+
buildkitd &
14+
15+
# Wait for buildkitd to be ready
16+
try=0
17+
max=10
18+
until buildctl debug workers >/dev/null 2>&1; do
19+
if [ $try -gt $max ]; then
20+
echo >&2 "buildkitd not ready after $max trials"
21+
exit 1
22+
fi
23+
sleep $(awk "BEGIN{print (100 + $try * 20) * 0.001}")
24+
try=$(expr $try + 1)
1625
done
1726

1827
export default_options="type=azblob,container=cachecontainer,account_url=http://${AZURE_ACCOUNT_URL}:${BLOB_PORT},secret_access_key=${AZURE_ACCOUNT_KEY}"

0 commit comments

Comments
 (0)