Repository navigation
fix(smoke): capture a page before testing it, and explain a failed check (#217) - #223
Merged
Merged
Conversation
… scripts (#217) The smoke scripts run under pipefail; curl | grep -q fails the pipeline when curl still has bytes after grep has matched and gone. The guard sweeps backup-smoke, image-smoke and upgrade-smoke. It is red on backup-smoke lines 51, 63 and 107 and image-smoke line 26 until the next commit. Refs #217 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ck (#217) bin/backup-smoke piped curl into grep -q under pipefail: once grep matched and exited, curl's next write failed (exit 23) and the check reported the lot missing although it was on the page. A page the size of the restored /collection, delivered in two writes, failed 100 of 100 times with GNU grep. The collection page is now saved to a file and searched, the port and CSRF token are cut without a pipe into head, and image-smoke's port lookup the same. When the check fails it prints the status, byte count, redirect target, whether the cookie jar holds a session cookie and the first 300 bytes of the body; a failed sign-in prints its status. Refs #217 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…iled fetch (#217) Implementation review findings: the diagnostic counted _collector_session, which the sign-in form sets alone, instead of session_id, the login's cookie; a curl failure replaced the status line it had printed; the guard's limits and the trial's 5 ms gap are stated; the exclude is in order. Refs #217 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A memory for the macOS dev machine's container engine (docker via colima, no podman, the mktemp shim, the denied anonymous ghcr pull) and two lessons: a pipe into grep -q under pipefail, and a probe that finds nothing needing a positive control. Refs #217 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
plainprogrammer
marked this pull request as ready for review
November 6, 2026 20:09
This was referenced Nov 6, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #217 (not
Closes: the CI trigger isn't reproduced, so #217 closes after greenImage (linux/arm64)jobs onmain).What is wrong
bin/backup-smoke's check of the restored collection page wascurl -s … /collection | grep -q "Smoke Dragon" || fail …in a script underset -euo pipefail.grep -qexits at the first read that holds a match; if curl still has bytes to write it gets EPIPE (exit 23), andpipefailfails the pipeline although the lot was on the page. The same pipe-into-an-early-reader shape was in the script's port and CSRF-token cuts (| head -n 1) and inbin/image-smoke's port cut.Evidence (the mechanism is proven; the CI trigger is not)
Probe: a server sends a page shaped like the restored
/collection(13,516 bytes, firstSmoke Dragonat byte 11,235 with about 2.3 KB after it, lines as the real page has) in two writes, and the script's exact check runs 100 times per case, with GNU grep 3.11 inside the collector image (CI's runners use GNU grep):curl | grep -q(before)curl --trace-asciiagainst one restored instance showed one receive of 13,516 bytes, 2,873+4,096+6,547 and 6,957+6,559.bin/image-smoke:37already says "no pipe can end early under pipefail" for its own task output.--network hostcontainer through docker-proxy, idle and with the colima VM's 4 CPUs saturated): 0 failures. Nothing here failed before the change, so the clean runs below are not a before/after.bin/upgrade-smokeandscript/upgrade/have no shell pipe (Ruby harness).Change
spec/smoke_scripts_spec.rb(written first, red onbin/backup-smokelines 51, 63, 107 andbin/image-smokeline 26, committed before the fix): sweepsbin/backup-smoke,bin/image-smokeandbin/upgrade-smokefor a pipe intoheador a quittinggrep, with negative controls for its matcher and a comment listing what it can't see.bin/backup-smoke: the collection page is saved to a file with its status, size and redirect (collection_has_lot) and then searched; the port and CSRF token are cut withouthead;sign_inprints its status when it fails. When the lot check fails it prints the status, the byte count, the redirect target, whether the cookie jar holds thesession_idcookie (the sign-in's;_collector_sessionis set by the form alone) and the first 300 bytes of the body.bin/image-smoke: the port cut withouthead.docs/architecture/release-and-deploy.md: the rule, the guard, the diagnostics, the honest limit, and Flaky: backup smoke on arm64 fails "the lot isn't on the collection page" after a restore #217 in Sources..rubocop.yml: the new spec in theRSpec/DescribeClassexcludes.chore(memory)), approved by the coordinator.Dockerfileor workflow edit.Proof
bin/backup-smoke collector:smoke217on a local arm64 image (docker 29 through colima; podman isn't installed here and the anonymous pull ofedgeis denied, so the image was built from this checkout): 20 of 20 passes of the script as first fixed, then 20 of 20 of the final script. Each run 16–32 s. Again, not a before/after.answered: 200 13516 [status, bytes, redirect], thesession_idline count and the page start; a wrong password printssign-in … answered 422.bin/image-smoke collector:smoke217: OK.bin/rspec --dry-runcount; the pre-pushbin/cipassed ate1532e6).e1532e6, run 42284830800: all green,Image (linux/arm64)(2m44s, job 128124758438) andImage (linux/amd64)included. One green arm64 job is weak evidence at the observed rate (2 of the last ~11mainruns), which is why this isRefs: Flaky: backup smoke on arm64 fails "the lot isn't on the collection page" after a restore #217 closes after green arm64 jobs onmain.Implementation review (Opus, read-only)
Verdict first: NEEDS CHANGES, then fixed to SPEC-ALIGNED in
01be01e. One major finding: the cookie diagnostic counted_collector_sessioninstead of the login'ssession_id; fixed. Minor, applied: curl's status kept when curl fails,0printed for a missing jar, the exclude's alphabetical place, the probe's 5 ms gap stated, "about 3,800". Minor, noted: the guard reads line by line (it can't see a trailing|,|&,egrep,sed q; written into the spec), and sweeping the Rubybin/upgrade-smokeis a guard for a future pipe.🤖 Generated with Claude Code