Run the unit tests with DEBUG_LOG_OUT in the case of RUN_UNIT_TESTS_SEQUENTIAL.
Because the output would be too big (about 80MB), redirect it to a file and only show relevant bits from it in case of errors.
Run the unit tests with DEBUG_LOG_OUT in the case of RUN_UNIT_TESTS_SEQUENTIAL.
Because the output would be too big (about 80MB), redirect it to a file and only show relevant bits from it in case of errors.
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--006a51241073e994b41acfe9ec718e94-->
For detailed information about the code coverage, see the test coverage report.
<!--021abf342d371248e50ceaed478a90ca-->
See the guideline for information on the review process.
| Type | Reviewers |
|---|---|
| Concept ACK | jonatack |
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
<!--174a7506f384e20aa4161008e828411d-->
No conflicts as of last run.
188 | + q 189 | +EDCOMMANDS 190 | + done 191 | + exit 1 192 | + fi 193 | + "
Not sure about 20 lines of bash code that are impossible to read, likely no one will review, and which are hard to maintain or change in the future.
On a second though, I wonder how often this feature will be needed, or if there is a simpler hack that achieves something similar.
Some of this was already there before. The new code is:
# find all lines that match 'error: in test_suite/test_case' and extract the test suite and case
for t in \$(sed -E -n 's/.*error: in \"(.+\\/.+)\":.*/\\1/p' < ${LOG}) ; do
test_suite=\${t%/*} # e.g. net_tests
test_case=\${t#*/} # e.g. v2transport_test
ed -s ${LOG} <<EDCOMMANDS
/Entering test suite \"\${test_suite}\"/
/Entering test case \"\${test_case}\"/,/Leaving test case \"\${test_case}\"/p
q
EDCOMMANDS
I do not think that is too different in terms of complexity from what we already have:
%.cpp.test: %.cpp [@echo](/bitcoin-bitcoin/contributor/echo/) Running tests: $$(\
cat $< | \
grep -E "(BOOST_FIXTURE_TEST_SUITE\\(|BOOST_AUTO_TEST_SUITE\\()" | \
cut -d '(' -f 2 | cut -d ',' -f 1 | cut -d ')' -f 1\
) from $<
$(AM_V_at)export TEST_LOGFILE=$(abs_builddir)/$$(\
echo $< | grep -E -o "(wallet/test/.*\.cpp|test/.*\.cpp)" | $(SED) -e s/\.cpp/.log/ \
) && \
$(TEST_BINARY) --catch_system_errors=no -l test_suite -t "$$(\
cat $< | \
grep -E "(BOOST_FIXTURE_TEST_SUITE\\(|BOOST_AUTO_TEST_SUITE\\()" | \
cut -d '(' -f 2 | cut -d ',' -f 1 | cut -d ')' -f 1\
)" -- DEBUG_LOG_OUT > "$$TEST_LOGFILE" 2>&1 || (cat "$$TEST_LOGFILE" && false)
If you find ed hard to read then I could change it to another language (python?) but I suspect it is going to be more lines of code. I any case, I don't think that's prohibitively complex task: "find 'Entering test suite', after that print the lines between 'Entering test case' and 'Leaving test case'".
Some extra escaping is needed because this is inside bash -c "here;". What is the point of doing that, given that this is already a bash script? I guess doing just here; should have the same effect.
I wonder how often this feature will be needed
This I do not know, but I know that when a test fails on CI that depends on a particular seed, having that seed is a game changer for fixing the bug.
Another option would be to print the seed unconditionally, even if DEBUG_LOG_OUT is not defined. But having the debug log in case of failure is useful beyond the rng seed.
Another option would be to print the seed unconditionally
Sure, why not?
To extend my previous feedback, on why this bash code isn't ideal:
set -ex in the script? Is the error code properly propagated in all cases? We've had tests in the past that silently passed regardless of the result, so it would be good to not accidentally re-introduce that. Doing output parsing in bash makes it easy to discard the error code, for example when adding a pipe but no pipefail.I do not think that is too different in terms of complexity from what we already have:
Pretty sure this will go away with cmake, no?
Another option would be to print the seed unconditionally
Sure, why not?
Yeah, this will solve the original issue with the seed. But I think this PR has a wider benefit of seeing the debug log for any type of failure, like in the RUN_UNIT_TESTS case.
To extend my previous feedback, on why this bash code isn't ideal:
Thanks, that makes it easier to understand and address.
- It assumes a specific unit test output format, so if boost is removed or if the format or wording changes, the code will silently stop to work
True, but that will not remain unnoticed (as long as somebody cares to look at the log after a failure) and should be easy to adjust. This can use test_bitcoin --log_format=XML or JUNIT. Even with that the point is still valid - if the format is changed then this would have to be adjusted. I think the benefit of seeing the debug log outweights the need to possibly have to adjust this in the future.
- Putting the bash code into a string and then executing the string makes it impossible to check with shellcheck. And also manual review is hard, because everything is escaped.
I agree, removed the bash -c "..." surrounding. Why is that used all over the place in 06_script_b.sh?
- How does it interact with
set -exin the script? Is the error code properly propagated in all cases? We've had tests in the past that silently passed regardless of the result, so it would be good to not accidentally re-introduce that. Doing output parsing in bash makes it easy to discard the error code, for example when adding a pipe but no pipefail.
It works correctly - if ! command that fails ; then foo ; exit 1; fi the failing command will not trigger the exit due to set -e and will execute all commands inside the if body. I put exit 1 at the end to terminate the script because being inside the if means the command failed.
I do not think that is too different in terms of complexity from what we already have:
Pretty sure this will go away with cmake, no?
Good point. And actually my argument was flawed - already having some "bad" code is not enough justification, alone, to add more of the same.
I agree, removed the
bash -c "..."surrounding. Why is that used all over the place in06_script_b.sh?
It is a leftover from the travis integration that started to use Docker initially, I think.
Edit: Yes, see 59e9688eda4c4b01ee1713625632cd766c1a7ca9
I was thinking about getting rid of it. Maybe even completely rewrite the whole script in a sane language, instead of "rewriting" half of it from bash to bash.
fd4ba89575...67f3a76a0a: improve readability
67f3a76a0a...1bc0914143: add quotes around ${variables} to pet the linter
CI:
+ '[' -n '' ']'
+ '[' false = true ']'
+ '[' true = true ']'
+ LOG=/ci_container_base/ci/scratch/build/test_bitcoin.log
+ DIR_UNIT_TEST_DATA=/ci_container_base/ci/scratch/qa-assets/unit_test_data/ LD_LIBRARY_PATH=/ci_container_base/depends/x86_64-pc-linux-gnu/lib /ci_container_base/ci/scratch/out/bin/test_bitcoin --catch_system_errors=no -l test_suite -- DEBUG_LOG_OUT
++ sed -E -n 's|.*error: in "(.+)/(.+)":.*|\1 \2|p'
+ FAILED_TESTS=
+ printf 'Error: the following tests failed from test_bitcoin:\n%s\n' ''
Error: the following tests failed from test_bitcoin:
+ read test_suite test_case
+ ed -s /ci_container_base/ci/scratch/build/test_bitcoin.log
/ci_container_base/ci/test/06_script_b.sh: line 185: ed: command not found
Exit status: 127����������������
previous releases, qt5 dev package and depends packages, DEBUG does not run anymore in my personal github repository (due to "No public persistent worker pools found!"). I will push a few times here, sorry for the noise. Converted to Draft.
I deliberately broke some tests to see how this will report the failures. Looks good:
<details> <summary>CI log from artificial failures</summary>
+ LOG=/ci_container_base/ci/scratch/build/test_bitcoin.log
+ DIR_UNIT_TEST_DATA=/ci_container_base/ci/scratch/qa-assets/unit_test_data/
+ LD_LIBRARY_PATH=/ci_container_base/depends/x86_64-pc-linux-gnu/lib
+ /ci_container_base/ci/scratch/out/bin/test_bitcoin --catch_system_errors=no --color_output=false --log_level=test_suite -- DEBUG_LOG_OUT
++ sed -E -n 's|.*error: in "(.+)/(.+)":.*|\1 \2|p'
++ sort -u
+ FAILED_TESTS='arith_uint256_tests basics
crypto_tests hmac_sha256_testvectors
crypto_tests ripemd160_testvectors
uint256_tests basics'
+ printf 'Error: the following tests failed from test_bitcoin:\n%s\n' 'arith_uint256_tests basics
crypto_tests hmac_sha256_testvectors
crypto_tests ripemd160_testvectors
uint256_tests basics'
Error: the following tests failed from test_bitcoin:
arith_uint256_tests basics
crypto_tests hmac_sha256_testvectors
crypto_tests ripemd160_testvectors
uint256_tests basics
+ read test_suite test_case
+ ed -s /ci_container_base/ci/scratch/build/test_bitcoin.log
test/arith_uint256_tests.cpp(18): Entering test suite "arith_uint256_tests"
test/arith_uint256_tests.cpp(68): Entering test case "basics"
test/arith_uint256_tests.cpp(70): error: in "arith_uint256_tests/basics": check false has failed
test/arith_uint256_tests.cpp(68): Leaving test case "basics"; testing time: 1726us
+ read test_suite test_case
+ ed -s /ci_container_base/ci/scratch/build/test_bitcoin.log
test/crypto_tests.cpp(28): Entering test suite "crypto_tests"
test/crypto_tests.cpp(459): Entering test case "hmac_sha256_testvectors"
2023-10-31T09:08:26.365840Z [test] [test/util/random.cpp:31] [Seed] Seed: Setting random seed for current tests to RANDOM_CTX_SEED=c5cfe029b57c3d3e34ab62c0a41c092b5bdbf67486eab8f3ec47f86ef0ca536e
2023-10-31T09:08:26.365877Z [test] [init/common.cpp:153] [LogPackageVersion] Bitcoin Core version v26.99.0-86ddf78fc463-dirty (debug build)
2023-10-31T09:08:26.366041Z [test] [kernel/context.cpp:24] [Context] Using the 'x86_shani(1way,2way)' SHA256 implementation
2023-10-31T09:08:26.366052Z [test] [random.cpp:98] [ReportHardwareRand] Using RdSeed as an additional entropy source
2023-10-31T09:08:26.366058Z [test] [random.cpp:101] [ReportHardwareRand] Using RdRand as an additional entropy source
2023-10-31T09:08:26.366695Z [test] [script/sigcache.cpp:103] [InitSignatureCache] Using 16 MiB out of 16 MiB requested for signature cache, able to store 524288 elements
2023-10-31T09:08:26.367058Z [test] [validation.cpp:1831] [InitScriptExecutionCache] Using 16 MiB out of 16 MiB requested for script execution cache, able to store 524288 elements
test/crypto_tests.cpp(38): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(51): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/hmac_sha256_testvectors": check hash == out has failed
test/crypto_tests.cpp(459): Leaving test case "hmac_sha256_testvectors"; testing time: 8277us
+ read test_suite test_case
+ ed -s /ci_container_base/ci/scratch/build/test_bitcoin.log
test/crypto_tests.cpp(28): Entering test suite "crypto_tests"
test/crypto_tests.cpp(368): Entering test case "ripemd160_testvectors"
2023-10-31T09:08:26.191363Z [test] [test/util/random.cpp:31] [Seed] Seed: Setting random seed for current tests to RANDOM_CTX_SEED=c5cfe029b57c3d3e34ab62c0a41c092b5bdbf67486eab8f3ec47f86ef0ca536e
2023-10-31T09:08:26.191426Z [test] [init/common.cpp:153] [LogPackageVersion] Bitcoin Core version v26.99.0-86ddf78fc463-dirty (debug build)
2023-10-31T09:08:26.191610Z [test] [kernel/context.cpp:24] [Context] Using the 'x86_shani(1way,2way)' SHA256 implementation
2023-10-31T09:08:26.191626Z [test] [random.cpp:98] [ReportHardwareRand] Using RdSeed as an additional entropy source
2023-10-31T09:08:26.191632Z [test] [random.cpp:101] [ReportHardwareRand] Using RdRand as an additional entropy source
2023-10-31T09:08:26.192320Z [test] [script/sigcache.cpp:103] [InitSignatureCache] Using 16 MiB out of 16 MiB requested for signature cache, able to store 524288 elements
2023-10-31T09:08:26.192683Z [test] [validation.cpp:1831] [InitScriptExecutionCache] Using 16 MiB out of 16 MiB requested for script execution cache, able to store 524288 elements
test/crypto_tests.cpp(38): error: in "crypto_tests/ripemd160_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/ripemd160_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/ripemd160_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/ripemd160_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/ripemd160_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/ripemd160_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/ripemd160_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/ripemd160_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/ripemd160_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/ripemd160_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/ripemd160_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/ripemd160_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/ripemd160_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/ripemd160_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/ripemd160_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/ripemd160_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/ripemd160_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/ripemd160_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/ripemd160_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/ripemd160_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/ripemd160_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/ripemd160_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/ripemd160_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/ripemd160_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/ripemd160_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/ripemd160_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/ripemd160_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/ripemd160_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/ripemd160_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/ripemd160_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/ripemd160_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/ripemd160_testvectors": check hash == out has failed
test/crypto_tests.cpp(55): error: in "crypto_tests/ripemd160_testvectors": check hash == out has failed
test/crypto_tests.cpp(368): Leaving test case "ripemd160_testvectors"; testing time: 164979us
+ read test_suite test_case
+ ed -s /ci_container_base/ci/scratch/build/test_bitcoin.log
test/uint256_tests.cpp(18): Entering test suite "uint256_tests"
test/uint256_tests.cpp(75): Entering test case "basics"
test/uint256_tests.cpp(125): error: in "uint256_tests/basics": check 0 has failed
test/uint256_tests.cpp(75): Leaving test case "basics"; testing time: 207us
+ read test_suite test_case
+ exit 1
</details>
Concept ACK.
(Maybe unrelated, but the Win64 CI task is one I've often wished for more debug info from when a unit test fails.)
172 | + # it to a file and only if errors occur, then extract the relevant snippets 173 | + # from it - between "Entering test case" and "Leaving test case". 174 | + LOG="${BASE_BUILD_DIR}/test_bitcoin.log" 175 | + if ! DIR_UNIT_TEST_DATA="${DIR_UNIT_TEST_DATA}" \ 176 | + LD_LIBRARY_PATH="${DEPENDS_DIR}/${HOST}/lib" \ 177 | + ${TEST_RUNNER_ENV} \
I don't think this works. You can set export TEST_RUNNER_ENV="ENV_VAR_FOO_BAR=foo_bar" and observe a failure?
Given the 4 force-pushes here already, and given that this still is broken, I again wonder if a type-safe language would be a better fit for a CI script. This way, it can be quickly compiled locally, if needed, to catch most of those errors that right now only can be caught at runtime.
Easiest is to drop it after #28954 which removes TEST_RUNNER_ENV altogether.
A type-safe language might be a better fit for this, but it is already written in bash and I chose the path of least resistance. IMO the changes in their current form (after #28954 is merged) are an improvement over the current situation. The fact that there might be even better improvement does not make them less valuable.
I wouldn't go at rewriting this in another language. If you do, I can review.
Yeah, just a style nit, feel free to ignore. Though, I wonder if there is anyone who is willing to review this bash code?
8 | @@ -9,7 +9,7 @@ export LC_ALL=C.UTF-8 9 | export CONTAINER_NAME=ci_native_qt5 10 | export CI_IMAGE_NAME_TAG="docker.io/debian:bullseye" 11 | # Use minimum supported python3.9 and gcc-10, see doc/dependencies.md 12 | -export PACKAGES="gcc-10 g++-10 python3-zmq qtbase5-dev qttools5-dev-tools libdbus-1-dev libharfbuzz-dev" 13 | +export PACKAGES="gcc-10 g++-10 python3-zmq qtbase5-dev qttools5-dev-tools libdbus-1-dev libharfbuzz-dev ed"
I don't think this works either. If another CI task other than this one is run with RUN_UNIT_TESTS_SEQUENTIAL=true, it will fail as well?
You'd have to put it in the global packages env var.
the global packages env var
Do you mean this one?
Added to CI_BASE_PACKAGES in latest push.
e3ade1fbc1...2b7888ec3e: rebase due to conflicts and add the ed package to CI_BASE_PACKAGES (see #28736 (review)).
Resolves https://github.com/bitcoin/bitcoin/issues/28466
2b7888ec3e...57e8bc6b31: rebase due to conflicts
The PR didn't seem to attract much attention in the past. Also, the issue seems not important enough right now to keep it sitting around idle in the list of open PRs.
Closing due to lack of interest.
To add some context. I think it would be nice to print the seed. However, the changes here had to be pushed several times, because the bash code was wrong, and the current version passes CI, but it is unclear if the bash code is correct.
For example, it seems better to fail CI on a test failure and not print the seed, than to print the seed and not fail the CI on a test failure.