test: also reset CConnman::m_private_broadcast in tests

Member variables of `CConnman::m_private_broadcast` (introduced in
https://github.com/bitcoin/bitcoin/pull/29415) could influence the tests
which creates non-determinism if the same instance of `CConnman` is used
for repeated test iterations.

So, reset the state of `CConnman::m_private_broadcast` from
`ConnmanTestMsg::Reset()`. Currently this affects the fuzz tests
`process_message` and `process_messages`.

Reported in
https://github.com/bitcoin/bitcoin/issues/34476#issuecomment-3849088794
This commit is contained in:
Vasil Dimov
2026-02-05 09:45:20 +01:00
parent 91b7c874e2
commit 2cb7e99dee
2 changed files with 5 additions and 1 deletions

View File

@@ -84,6 +84,8 @@ void ConnmanTestMsg::Reset()
{
ResetAddrCache();
ResetMaxOutboundCycle();
m_private_broadcast.m_outbound_tor_ok_at_least_once.store(false);
m_private_broadcast.m_num_to_open.store(0);
}
void ConnmanTestMsg::NodeReceiveMsgBytes(CNode& node, std::span<const uint8_t> msg_bytes, bool& complete) const