HomePhabricator

[test] Pretty print expected messages when asserting a debug log

Description

[test] Pretty print expected messages when asserting a debug log

Summary:
Some tests like contenders look for a lot of expected messages in the debug log at once. This is difficult to read, especially where it breaks across the terminal screen. Pretty printing the expected_msgs list fixes this.

A width of 120 instead of the usual 80 was chosen because it is very common for a hash (64 chars) to be included in expected_msgs but it can be hard to squeeze the rest of the match into the remaining 16 characters. Otherwise each expected_msgs includes a line break which just isn't necessary on most screens.

Depends on D18007

Test Plan: Tweak expected messages in assert_debug_log and wait_for_debug_log calls in any test (especially abc_p2p_avalanche_contender_voting). Run the test and observe expected_msgs is easier to read.

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
roqqitAuthored on Mon, Apr 28, 18:40
roqqitPushed on Mon, Apr 28, 22:16
Reviewer
Restricted Project
Differential Revision
D18008: [test] Pretty print expected messages when asserting a debug log
Parents
rABC645747705d1f: [test] Swap debug log and expected messages error string
Branches
Unknown
Tags
Unknown
References
HEAD -> master