mirror of
https://github.com/xroche/httrack.git
synced 2026-08-13 11:12:19 +03:00
Teardown must not decide a test's verdict
Under set -e a failing command in an EXIT trap becomes the script's exit status, so a cleanup hiccup fails a test whose assertions all passed. Run teardown with errexit off, on EXIT only: sharing set +e with the signal traps would leave errexit off for the rest of a signalled run, where a torn-down test could still report success. A failing teardown command still prints its own diagnostic, so nothing is silenced. The return 0 that three cleanup() bodies ended with never protected anything: errexit fires at the failing command before it is reached. Closes #773 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Xavier Roche <xroche@gmail.com>
This commit is contained in:
@@ -31,7 +31,7 @@ cleanup() {
|
||||
done
|
||||
rm -rf "$tmpdir"
|
||||
}
|
||||
trap cleanup EXIT
|
||||
trap 'set +e; cleanup' EXIT
|
||||
|
||||
# self-signed cert for the local TLS origin (httrack does not verify certs)
|
||||
openssl req -x509 -newkey rsa:2048 -keyout "$tmpdir/key.pem" \
|
||||
|
||||
Reference in New Issue
Block a user