Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve upstream failures when suppressing SIGPIPE

When a supplied smokeCommand pipes a fetch into grep -q, a fetch that emits matching content and then fails can be treated as successful: this disables pipefail, so grep's zero status hides the fetch failure and the deployment passes smoke. Preserve non-SIGPIPE producer failures while ignoring the expected broken-pipe status; the same change appears in the turbo and assets-turbo jobs.

Useful? React with 👍 / 👎.

{{ .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
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading