On slower runs, the txospender index may not be synced yet when the tests of its behavior begin, causing intermittent failures. Wait for them to be synced before starting the tests.
The tests also query mempool txs from other nodes, make sure mempools are synced before doing so.
The first commit with the following diff reproduces #34735:
0diff --git a/src/index/txospenderindex.cpp b/src/index/txospenderindex.cpp
1index d451bb1e0a4..e786f05a98c 100644
2--- a/src/index/txospenderindex.cpp
3+++ b/src/index/txospenderindex.cpp
4@@ -129,6 +129,7 @@ static std::vector<std::pair<COutPoint, CDiskTxPos>> BuildSpenderPositions(const
5
6 bool TxoSpenderIndex::CustomAppend(const interfaces::BlockInfo& block)
7 {
8+ UninterruptibleSleep(100ms);
9 WriteSpenderInfos(BuildSpenderPositions(block));
10 return true;
11 }
Fixes #34735