itest+lntest: fix flake in testListSweeps

We now make sure we assert the `ListSweeps` results in a wait closure.
This commit is contained in:
yyforyongyu
2025-07-09 16:24:57 +03:00
parent 0e830da9d9
commit 52d963bae0
4 changed files with 76 additions and 21 deletions

View File

@@ -2059,9 +2059,14 @@ func (h *HarnessTest) CalculateTxesFeeRate(txns []*wire.MsgTx) int64 {
func (h *HarnessTest) AssertSweepFound(hn *node.HarnessNode,
sweep string, verbose bool, startHeight int32) {
req := &walletrpc.ListSweepsRequest{
Verbose: verbose,
StartHeight: startHeight,
}
err := wait.NoError(func() error {
// List all sweeps that alice's node had broadcast.
sweepResp := hn.RPC.ListSweeps(verbose, startHeight)
sweepResp := hn.RPC.ListSweeps(req)
var found bool
if verbose {