In test/functional/interface_usdt_net.py
, assert_equal
is already used to check for equality between objects. Replace assert.*==
with assert_equal
and assert.*>
with assert_greater_than
to further easify debugging.
Relevant issue: #23119
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32091.
See the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
In test/functional/interface_usdt_net.py, assert_equal is already
used to check for equality between objects. Replace 'assert.*=='
with 'assert_equal' and 'assert.*>' with 'assert_greater_than'
to further easify debugging.
478@@ -479,9 +479,9 @@ def handle_misbehaving_connection(_, data, __):
479
480 assert_equal(EXPECTED_MISBEHAVING_CONNECTIONS, len(misbehaving_connections))
481 for misbehaving_connection in misbehaving_connections:
482- assert misbehaving_connection.id > 0
483- assert len(misbehaving_connection.message) > 0
484- assert misbehaving_connection.message == b"headers message size = 2001"
485+ assert_greater_than(misbehaving_connection.id, 0)
486+ assert_greater_than(len(misbehaving_connection.message), 0)
487+ assert_equal(misbehaving_connection.message, b"headers message size= 2001")
build
directory using ctest --output-on-failure
and the modified test passed just fine there. Any idea on what might cause the discrepancy?
I ran the entire test suite from my
build
directory usingctest --output-on-failure
and the modified test passed just fine there. Any idea on what might cause the discrepancy?
I assume you built bitcoind without USDT support. One simple way to do enable it is e.g. configuring CMake via cmake --preset dev-mode
. What happens if you run the individual test, i.e. $ ./build/test/functional/interface_usdt_net.py
?
What happens if you run the individual test, i.e. $ ./build/test/functional/interface_usdt_net.py
You were right, I didn’t compile bitcoind with USDT support. Running the individual test results in the following output:
02025-03-18T18:06:36.018000Z TestFramework (INFO): PRNG seed is: 6897053979890084060
12025-03-18T18:06:36.021000Z TestFramework (WARNING): Test Skipped: bitcoind has not been built with USDT tracepoints enabled.
22025-03-18T18:06:36.074000Z TestFramework (INFO): Stopping nodes
32025-03-18T18:06:36.075000Z TestFramework (INFO): Cleaning up /tmp/bitcoin_func_test_m5zcf3_7 on exit
42025-03-18T18:06:36.075000Z TestFramework (INFO): Test skipped
Running the test in dev-mode build configuration with cmake --preset dev-mode
seems to fix this.