Commit 6d8e306
committed
ci: propagate curl's exit status in the archive canary
`read -r ... < <(curl ...)` returns read's own status and discards curl's.
A transfer that fails after the response headers — a truncated body, exit
18 or 56 — still emits `%{http_code} 200`, so every assertion below it
passed on a fetch that never completed. Raised in review of #2376.
Verified rather than assumed. Simulating curl emitting its -w output and
then exiting 56:
read -r a b c < <(printf '200 0 https://x/\n'; exit 56)
-> script continues with status=200, exit 0
out="$( { printf '200 0 https://x/\n'; exit 56; } )" || rc=$?
-> rc=56, caught
Switches to command substitution with an explicit `|| rc=$?` capture, so
the status can be inspected before `set -e` acts on it, and parses with a
here-string — which also supplies the trailing newline `read` needs, making
the `\n` in the -w format redundant.
Fifth false-pass path closed in this workflow, and the fourth found in
review. Each one had the same shape: a check that reports success without
having measured the thing it names.
Signed-off-by: Mark Chmarny <mark@chmarny.com>1 parent a57c133 commit 6d8e306
1 file changed
Lines changed: 18 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
172 | 180 | | |
173 | 181 | | |
174 | | - | |
175 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
176 | 187 | | |
177 | 188 | | |
178 | 189 | | |
| |||
0 commit comments