itest+lntest: fix flake in MPP-related tests

This commit is contained in:
yyforyongyu
2024-11-21 14:09:57 +08:00
parent fb59669ae8
commit cfb5713cda
2 changed files with 31 additions and 3 deletions

View File

@@ -1513,13 +1513,14 @@ func (h *HarnessTest) AssertNumHTLCsAndStage(hn *node.HarnessNode,
lnutils.SpewLogClosure(target.PendingHtlcs)())
}
for i, htlc := range target.PendingHtlcs {
for _, htlc := range target.PendingHtlcs {
if htlc.Stage == stage {
continue
}
return fmt.Errorf("HTLC %d got stage: %v, "+
"want stage: %v", i, htlc.Stage, stage)
return fmt.Errorf("HTLC %s got stage: %v, "+
"want stage: %v", htlc.Outpoint, htlc.Stage,
stage)
}
return nil