Skip to content

Commit aa06876

Browse files
committed
Flakiness in azblob test job
Attempt to fix the flakiness in the azblob test job by updating the logic for checking if buildkitd is up and running Fixes moby#3369 Signed-off-by: Pranav Pandit <[email protected]>
1 parent 617b78c commit aa06876

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)