HomePhabricator

test: Fix wait_for_debug_log UnicodeDecodeError

Description

test: Fix wait_for_debug_log UnicodeDecodeError

Summary:

Fix the intermittent UnicodeDecodeError when the debug log is truncated on an (multi-byte) unicode character by treating everything as bytes.

Also, remove the ignore_case option and there.search+re.escape wrap. All of this is unused and doesn't exist on raw byte strings.

This is a backport of core#25294

Depends on D12622

Note:
I added a typehint for expected_msgs because imo the parameter name is now misleading with regards to its type. This allowed the mypy linter to detect that a subsequent line defining print_log is now broken because log is now of type bytes and you cannot join bytes with str

Test Plan: ninja check-functional

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

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

Details

Provenance
MacroFake <falke.marco@gmail.com>Authored on Jun 7 2022, 14:50
PiRKCommitted on Nov 25 2022, 17:00
PiRKPushed on Nov 25 2022, 17:00
Reviewer
Restricted Project
Differential Revision
D12624: test: Fix wait_for_debug_log UnicodeDecodeError
Parents
rABC6175151d3aef: index: make indices robust against init aborts
Branches
Unknown
Tags
Unknown