Skip to content

fix(smoke): retry a failed attempt again (0.19.2) - #26

Merged
vijayakrishnans merged 1 commit into
release/0.19.xfrom
claude/smoke-retry-errexit-0.19
Nov 16, 2026
Merged

vijayakrishnans merged 1 commit into
release/0.19.xfrom
claude/smoke-retry-errexit-0.19

Conversation

@vijayakrishnans

Copy link
Copy Markdown
Contributor

Bug: 0.19.1 turned the smoke retry loop into smoke; rc=$?. orun runs a step under bash -e, so the first failing attempt ends the step on the spot. There's no "attempt 1/10 failed" line, no backoff and no second attempt. Since #24 every Worker smoke is a single try.

Seen: vijayakrishnans/multi-tenant-saas-2, 06-console, run 43861505573 attempt 1. On both stage and prod the console deployed, then smoke failed 0.3s later with curl exit 22 (the brand-new workers.dev route still 404'd). A manual rerun passed and both URLs serve 200.

Fix: rc=0; smoke || rc=$? in the worker, worker-turbo and workers-assets-turbo verify-deploy jobs. errexit doesn't apply to a command on the left of ||. Version 0.19.2.

Checked: I pulled the loop out of the job and ran it under bash -e -c 'set -uo pipefail; …' with a smoke that fails twice: it logs attempts 1 and 2 with their exit codes and passes on attempt 3. Before the fix the same harness exits on attempt 1 with no log line.

After merge: tag v0.19.2 so release.yml publishes the OCI artifact. Baselines pinned to 0.19.1 need their pin bumped to pick it up.

🤖 Generated with Claude Code

0.19.1's attempt loop called `smoke; rc=$?`. orun runs a step's script under
`bash -e`, so the first failing attempt ended the step with the smoke's own
exit code: no "attempt 1/10 failed" line, no backoff, no second attempt. A
first deploy whose new workers.dev route 404s for a few seconds then failed
smoke in 0.3s with curl's exit 22 (multi-tenant-saas-2's console, stage and
prod, 2026-11-16), and only a manual rerun got it green.

The call is now `rc=0; smoke || rc=$?`, which errexit does not apply to, so
the ~4.5 minute budget and the exit-code log line work as $2 meant.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T12:01:00.856130Z b4107f5 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b4107f549e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

smoke; rc=$?
# Not `smoke; rc=$?`: orun runs a step under `bash -e`, so a bare failing
# call would end the step on attempt 1 and skip the whole retry budget.
rc=0; smoke || rc=$?

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 failures from multi-command smoke scripts

When a configured smokeCommand has multiple commands and relies on the step's bash -e (for example, a failed check followed by a successful logging command), calling smoke on the left of || makes Bash ignore errexit throughout the function's subshell. The later command can make the attempt return 0, so the loop reports a broken deployment as healthy instead of retrying or failing. Preserve errexit for the smoke body while capturing its status.

Useful? React with 👍 / 👎.

@vijayakrishnans
vijayakrishnans merged commit fc695b7 into release/0.19.x Nov 16, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant