From 4064a3ecdf978b771e23bd4c81ef5b1ed2806076 Mon Sep 17 00:00:00 2001 From: Eric Swanson Date: Tue, 26 Sep 2023 12:25:32 -0700 Subject: [PATCH] test: retry mops sources call in playground e2e tests --- e2e/assets/playground_backend/dfx.json | 2 +- e2e/assets/playground_backend/mops-sources | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100755 e2e/assets/playground_backend/mops-sources diff --git a/e2e/assets/playground_backend/dfx.json b/e2e/assets/playground_backend/dfx.json index dbae6de715..afdd89f86b 100644 --- a/e2e/assets/playground_backend/dfx.json +++ b/e2e/assets/playground_backend/dfx.json @@ -19,7 +19,7 @@ "defaults": { "build": { "output": "build", - "packtool": "mops sources" + "packtool": "./mops-sources" } } } \ No newline at end of file diff --git a/e2e/assets/playground_backend/mops-sources b/e2e/assets/playground_backend/mops-sources new file mode 100755 index 0000000000..56be5bd50a --- /dev/null +++ b/e2e/assets/playground_backend/mops-sources @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +set -e + +for i in 0 2 4 8 16 32; do + if [ $i -gt 0 ]; then + echo "retrying in $i seconds" 1>&2 + sleep $i + fi + + if output=$(mops sources); then + echo "$output" + exit 0 + fi + echo "failed with output: $output" 1>&2 +done +exit 1