From c0f6d846e2a184afdc3776db6fd010144bcceea6 Mon Sep 17 00:00:00 2001 From: vijayakrishnans Date: Fri, 13 Nov 2026 14:43:03 +0700 Subject: [PATCH] fix(smoke): a pipe into grep -q no longer fails a check that passed (0.23.0) The worker, worker-turbo and workers-assets-turbo verify-deploy jobs ran the product's smokeCommand under `set -o pipefail`. Every baseline asserts with `echo "$html" | grep -q x` or `curl | grep -q x`; grep -q exits at its first match, the writer dies of SIGPIPE (141), and pipefail turns that into a failure. Once the page outgrows the 64 KiB pipe buffer this fails on every attempt, so the retry budget only delays the red: screwfast's 126 KB home page failed smoke on stage and prod while both sites served correctly. Each attempt now runs in a subshell with pipefail off (a failed fetch still fails: grep sees no input), and every failed attempt logs its exit code, naming SIGPIPE when it is 141. Co-Authored-By: Claude Opus 5.5 --- .../cloudflare-worker-turbo-verify-deploy.yaml | 18 +++++++++++++----- .../jobs/cloudflare-worker-verify-deploy.yaml | 18 +++++++++++++----- ...are-workers-assets-turbo-verify-deploy.yaml | 18 +++++++++++++----- stack.yaml | 2 +- 4 files changed, 40 insertions(+), 16 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 787f7ca..b4c06d3 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 @@ -257,21 +257,29 @@ spec: # whole convergence on a manual rerun. run: | set -uo pipefail - smoke() { + # Each attempt runs in a subshell with pipefail OFF. A smoke assertion is + # the last command of its pipe (`echo "$html" | grep -q x`, `curl | grep -q x`): + # grep -q exits at its first match, the writer then dies of SIGPIPE (141), + # and under pipefail that kills a check whose text WAS found, on every + # attempt, once the page outgrows the 64 KiB pipe buffer. Without pipefail + # a failed fetch still fails: grep sees no input and finds nothing. + smoke() ( + set +o pipefail {{ .parameters.smokeCommand }} - } + ) attempts=10 for i in $(seq 1 "$attempts"); do - if smoke; then + smoke; rc=$? + if [ "$rc" -eq 0 ]; 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" + echo "smoke attempt $i/$attempts failed (exit $rc$([ "$rc" -eq 141 ] && echo ', SIGPIPE')) — retrying in ${wait}s" sleep "$wait" fi done - echo "smoke failed after $attempts attempts (~4.5m budget)" + echo "smoke failed after $attempts attempts (~4.5m budget); last exit $rc" 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 610d9f5..43c220a 100644 --- a/compositions/cloudflare-worker/jobs/cloudflare-worker-verify-deploy.yaml +++ b/compositions/cloudflare-worker/jobs/cloudflare-worker-verify-deploy.yaml @@ -113,21 +113,29 @@ spec: # 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() { + # Each attempt runs in a subshell with pipefail OFF. A smoke assertion is + # the last command of its pipe (`echo "$html" | grep -q x`, `curl | grep -q x`): + # grep -q exits at its first match, the writer then dies of SIGPIPE (141), + # and under pipefail that kills a check whose text WAS found, on every + # attempt, once the page outgrows the 64 KiB pipe buffer. Without pipefail + # a failed fetch still fails: grep sees no input and finds nothing. + smoke() ( + set +o pipefail {{ .parameters.smokeCommand }} - } + ) attempts=10 for i in $(seq 1 "$attempts"); do - if smoke; then + smoke; rc=$? + if [ "$rc" -eq 0 ]; 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" + echo "smoke attempt $i/$attempts failed (exit $rc$([ "$rc" -eq 141 ] && echo ', SIGPIPE')) — retrying in ${wait}s" sleep "$wait" fi done - echo "smoke failed after $attempts attempts (~4.5m budget)" + echo "smoke failed after $attempts attempts (~4.5m budget); last exit $rc" 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 c5bf772..1f209a7 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 @@ -158,21 +158,29 @@ spec: # 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() { + # Each attempt runs in a subshell with pipefail OFF. A smoke assertion is + # the last command of its pipe (`echo "$html" | grep -q x`, `curl | grep -q x`): + # grep -q exits at its first match, the writer then dies of SIGPIPE (141), + # and under pipefail that kills a check whose text WAS found, on every + # attempt, once the page outgrows the 64 KiB pipe buffer. Without pipefail + # a failed fetch still fails: grep sees no input and finds nothing. + smoke() ( + set +o pipefail {{ .parameters.smokeCommand }} - } + ) attempts=10 for i in $(seq 1 "$attempts"); do - if smoke; then + smoke; rc=$? + if [ "$rc" -eq 0 ]; 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" + echo "smoke attempt $i/$attempts failed (exit $rc$([ "$rc" -eq 141 ] && echo ', SIGPIPE')) — retrying in ${wait}s" sleep "$wait" fi done - echo "smoke failed after $attempts attempts (~4.5m budget)" + echo "smoke failed after $attempts attempts (~4.5m budget); last exit $rc" exit 1 onFailure: stop diff --git a/stack.yaml b/stack.yaml index 7266692..fbe9950 100644 --- a/stack.yaml +++ b/stack.yaml @@ -3,7 +3,7 @@ kind: Stack metadata: name: stack-tectonic title: Stack Tectonic - version: 0.22.0 + version: 0.23.0 description: Versioned OCI-hosted catalog of Cloudflare, Terraform and monorepo compositions for Sourceplane repositories. owner: sourceplane tags: