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
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--006a51241073e994b41acfe9ec718e94-->
For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32091.
<!--021abf342d371248e50ceaed478a90ca-->
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.
lgtm ACK 93fdaf1ca00de0bc46eb2455732582c34cef58b5
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")
actually, this looks wrong. Let's hope the test/CI fails.
I ran the entire test suite from my 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
builddirectory usingctest --output-on-failureand 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:
2025-03-18T18:06:36.018000Z TestFramework (INFO): PRNG seed is: 6897053979890084060
2025-03-18T18:06:36.021000Z TestFramework (WARNING): Test Skipped: bitcoind has not been built with USDT tracepoints enabled.
2025-03-18T18:06:36.074000Z TestFramework (INFO): Stopping nodes
2025-03-18T18:06:36.075000Z TestFramework (INFO): Cleaning up /tmp/bitcoin_func_test_m5zcf3_7 on exit
2025-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.
utACK 387385ba1edf9febdc75d39bd77b35b29714b3d0
lgtm ACK 387385ba1edf9febdc75d39bd77b35b29714b3d0
had a quick look, lgtm ACK 387385ba1edf9febdc75d39bd77b35b29714b3d0
code review ACK 387385ba1edf9febdc75d39bd77b35b29714b3d0
Great! ACK 387385ba1edf9febdc75d39bd77b35b29714b3d0