> test: introduce TestNode.debug_log_bytes
> test: add TestNode.wait_for_debug_log
> test: feature_init: retain debug.log and improve detection
>
> This test sporadically fails due to the Python test missing log lines
> for reasons that are poorly understood. The problem is made worse by the
> fact that this test does not retain the log files from iteration to
> iteration.
>
> Change the test to do logline detection in a more robust manner (by
> using `re.search` on the whole log content) in a way that is comparable
> to the existing `assert_debug_log` utility, and retain all debug.log
> content from case to case.
This is a partial backport of core#23737
https://github.com/bitcoin/bitcoin/pull/23737/commits/a2fb62b632d39e468f59e7e0b6890f82d0f5eebb
https://github.com/bitcoin/bitcoin/pull/23737/commits/a8ffbc01db85d918b8d1406b178b3c6f09123cf1
https://github.com/bitcoin/bitcoin/pull/23737/commits/93db6d8422345cc10db333d56ea9bcceefcf58b6
Depends on D12613