From 5c95d429bbb35bfe8b0a0a96b68b0074baee2d3e Mon Sep 17 00:00:00 2001 From: Rahul Varghese Date: Mon, 3 Aug 2026 16:21:42 +0530 Subject: [PATCH] fix(smoke): retry-with-backoff on EVERY composition's smoke, ~4.5m budget (0.18.2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 0.18.1 envelope only covered cloudflare-worker-turbo. The assets (console) and plain-worker compositions ran smokeCommand raw — and a first deploy's workers.dev route can take MINUTES to resolve (measured live: a console stage smoke failed on a route that served 200 minutes later, DAG-parking the prod deploy behind it with no failure of its own). All three verify-deploy jobs now run the same envelope: 10 attempts, backoff capped at 45s (~4.5 min budget). A real regression still fails after the budget; the convergence resume path stays the second line of defense. Co-Authored-By: Claude Fable 5 --- ...cloudflare-worker-turbo-verify-deploy.yaml | 6 ++--- .../jobs/cloudflare-worker-verify-deploy.yaml | 26 ++++++++++++++++++- ...re-workers-assets-turbo-verify-deploy.yaml | 25 +++++++++++++++++- stack.yaml | 2 +- 4 files changed, 53 insertions(+), 6 deletions(-) diff --git a/compositions/cloudflare-worker-turbo/jobs/cloudflare-worker-turbo-verify-deploy.yaml b/compositions/cloudflare-worker-turbo/jobs/cloudflare-worker-turbo-verify-deploy.yaml index 8d22fad..9a30ef9 100644 --- a/compositions/cloudflare-worker-turbo/jobs/cloudflare-worker-turbo-verify-deploy.yaml +++ b/compositions/cloudflare-worker-turbo/jobs/cloudflare-worker-turbo-verify-deploy.yaml @@ -221,18 +221,18 @@ spec: smoke() { {{ .parameters.smokeCommand }} } - attempts=6 + attempts=10 for i in $(seq 1 "$attempts"); do if smoke; then [ "$i" -gt 1 ] && echo "smoke passed on attempt $i/$attempts" exit 0 fi if [ "$i" -lt "$attempts" ]; then - wait=$(( i * 5 )) + wait=$(( i * 6 )); [ "$wait" -gt 45 ] && wait=45 echo "smoke attempt $i/$attempts failed — retrying in ${wait}s" sleep "$wait" fi done - echo "smoke failed after $attempts attempts" + echo "smoke failed after $attempts attempts (~4.5m budget)" exit 1 onFailure: stop diff --git a/compositions/cloudflare-worker/jobs/cloudflare-worker-verify-deploy.yaml b/compositions/cloudflare-worker/jobs/cloudflare-worker-verify-deploy.yaml index a765a6b..610d9f5 100644 --- a/compositions/cloudflare-worker/jobs/cloudflare-worker-verify-deploy.yaml +++ b/compositions/cloudflare-worker/jobs/cloudflare-worker-verify-deploy.yaml @@ -105,5 +105,29 @@ spec: capability: cloudflare-worker.smoke shell: bash working-directory: "{{ .parameters.appDir }}" - run: "{{ .parameters.smokeCommand }}" + run: | + set -uo pipefail + # smokeCommand runs under retry-with-backoff: a brand-new workers.dev + # route can take MINUTES to resolve on a first deploy (measured live + # — a console route 404'd for minutes then served 200), and a raw + # single-shot probe parks the whole convergence (and every DAG + # dependent) on a manual rerun. ~4.5 min budget; a real regression + # still fails after it. + smoke() { + {{ .parameters.smokeCommand }} + } + attempts=10 + for i in $(seq 1 "$attempts"); do + if smoke; then + [ "$i" -gt 1 ] && echo "smoke passed on attempt $i/$attempts" + exit 0 + fi + if [ "$i" -lt "$attempts" ]; then + wait=$(( i * 6 )); [ "$wait" -gt 45 ] && wait=45 + echo "smoke attempt $i/$attempts failed — retrying in ${wait}s" + sleep "$wait" + fi + done + echo "smoke failed after $attempts attempts (~4.5m budget)" + exit 1 onFailure: stop diff --git a/compositions/cloudflare-workers-assets-turbo/jobs/cloudflare-workers-assets-turbo-verify-deploy.yaml b/compositions/cloudflare-workers-assets-turbo/jobs/cloudflare-workers-assets-turbo-verify-deploy.yaml index bc55ae0..1047074 100644 --- a/compositions/cloudflare-workers-assets-turbo/jobs/cloudflare-workers-assets-turbo-verify-deploy.yaml +++ b/compositions/cloudflare-workers-assets-turbo/jobs/cloudflare-workers-assets-turbo-verify-deploy.yaml @@ -114,6 +114,7 @@ spec: capability: cloudflare-workers-assets-turbo.smoke shell: bash run: | + set -uo pipefail export ORUN_ENVIRONMENT="{{ .orun.environment.name }}" {{- if .parameters.environmentAwareWorkerName }} export EFFECTIVE_WORKER_NAME="{{ .parameters.workerName }}-{{ .orun.environment.name }}" @@ -124,5 +125,27 @@ spec: export WORKERS_DEV_SUBDOMAIN="{{ .parameters.workersDevSubdomain }}" export DEPLOYED_URL="https://${EFFECTIVE_WORKER_NAME}.${WORKERS_DEV_SUBDOMAIN}.workers.dev" {{- end }} - {{ .parameters.smokeCommand }} + # smokeCommand runs under retry-with-backoff: a brand-new workers.dev + # route can take MINUTES to resolve on a first deploy (measured live + # — a console route 404'd for minutes then served 200), and a raw + # single-shot probe parks the whole convergence (and every DAG + # dependent) on a manual rerun. ~4.5 min budget; a real regression + # still fails after it. + smoke() { + {{ .parameters.smokeCommand }} + } + attempts=10 + for i in $(seq 1 "$attempts"); do + if smoke; then + [ "$i" -gt 1 ] && echo "smoke passed on attempt $i/$attempts" + exit 0 + fi + if [ "$i" -lt "$attempts" ]; then + wait=$(( i * 6 )); [ "$wait" -gt 45 ] && wait=45 + echo "smoke attempt $i/$attempts failed — retrying in ${wait}s" + sleep "$wait" + fi + done + echo "smoke failed after $attempts attempts (~4.5m budget)" + exit 1 onFailure: stop diff --git a/stack.yaml b/stack.yaml index 4a15e08..059120e 100644 --- a/stack.yaml +++ b/stack.yaml @@ -3,7 +3,7 @@ kind: Stack metadata: name: stack-tectonic title: Stack Tectonic - version: 0.18.1 + version: 0.18.2 description: Versioned OCI-hosted catalog of Cloudflare, Terraform and monorepo compositions for Sourceplane repositories. owner: sourceplane tags: