HomePhabricator

[tests] Give a useful error message when assert_debug_log is called with empty…

Description

[tests] Give a useful error message when assert_debug_log is called with empty expected messages

Summary:
If given empty expected_msgs, assert_debug_log will return quickly without actually checking
much. This is dangerous if unexpected_msgs IS set, as the test will appear to pass when it hasn't.

The alternative is to reimplement this function so that it will wait for unexpected messages
when no expected messages are set, but running out the timeout does not seem like robust way to
do this. It's better to give assert_debug_log a "target" to hit and then check to make sure
we don't hit any explicit "non-targets" along the way.

Test Plan:

ninja check-functional
sed -i 's/expected_msgs=\["added time data"\]/expected_msgs=[]/g' abc-version-message.py
test_runner.py abc-version-message    # should fail with the new message

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D6041

Details

Provenance
jasonbcoxAuthored on May 12 2020, 00:57
jasonbcoxPushed on May 13 2020, 21:07
Reviewer
Restricted Project
Differential Revision
D6041: [tests] Give a useful error message when assert_debug_log is called with empty expected messages
Parents
rABCea95fb5fafee: [doc] since D5764, regtest requires standard txns by default
Branches
Unknown
Tags
Unknown