This PR addresses two issues related to the “Return non-zero exit code, with error message for stderr” check in the system_tests/run_command
test:
- The test now checks the exact exit code, which must be 1.
- The process invocation string is removed from the exception message before checking the stderr output, as the latter is a substring of the former.
This is an alternative to #32577 without introducing a shell wrapper and altering quotation in src/external_signer.cpp
.
The main idea is to avoid parsing the problematic sh -c 'echo err 1>&2 && false'
command with subprocess::Popen
.
In the past, this check used:https://github.com/bitcoin/bitcoin/blob/5abb9b1af49be9024f95fa2f777285c531785d85/src/test/system_tests.cpp#L56-L58
which was problematic due to its dependence on the system locale.
Fixes #32574.