From 4a2672bc29f878eea5ed2310806d630c270c6990 Mon Sep 17 00:00:00 2001 From: Matt Mastracci Date: Mon, 27 Nov 2023 18:44:48 -0700 Subject: [PATCH] chore: add retries to autobahn (#21365) --- ext/websocket/autobahn/fuzzingclient.js | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/ext/websocket/autobahn/fuzzingclient.js b/ext/websocket/autobahn/fuzzingclient.js index 8aa7166958..ee200e452b 100644 --- a/ext/websocket/autobahn/fuzzingclient.js +++ b/ext/websocket/autobahn/fuzzingclient.js @@ -11,7 +11,25 @@ const AUTOBAHN_TESTSUITE_DOCKER = const self = Deno.execPath(); $`${self} run -A --unstable ${pwd}/autobahn_server.js`.spawn(); -await $`docker run --name fuzzingserver -v ${pwd}/fuzzingclient.json:/fuzzingclient.json:ro -v ${pwd}/reports:/reports -p 9001:9001 --net=host --rm ${AUTOBAHN_TESTSUITE_DOCKER} wstest -m fuzzingclient -s fuzzingclient.json` + +for (let i = 0; i < 6; i++) { + try { + await $`docker pull ${AUTOBAHN_TESTSUITE_DOCKER}`; + break; + } catch (e) { + $.logError(`error: docker pull failed ${e}, waiting 10s`); + await new Promise((r) => setTimeout(r, 10000)); + } +} + +await $`docker run + --name fuzzingserver + -v ${pwd}/fuzzingclient.json:/fuzzingclient.json:ro + -v ${pwd}/reports:/reports + -p 9001:9001 + --net=host + --rm ${AUTOBAHN_TESTSUITE_DOCKER} + wstest -m fuzzingclient -s fuzzingclient.json` .cwd(pwd); const { deno_websocket } = JSON.parse(