lntest+itest: fix flakes found using neutrino backend

This commit makes sure the sweep requests are received before mining
blocks to trigger the actual sweeping.

In addition, `testFundingExpiryBlocksOnPending` is updated to deal with
the old `channel link not found` issue.
This commit is contained in:
yyforyongyu committed 2024-07-23 21:30:09 +08:00
1 parent 2608c0893e
commit 4dcce9df69
5 files changed
+43 -19

No files matched your search

+6 -1
View File
@@ -785,8 +785,13 @@ func (h *HarnessTest) AssertNumUTXOsWithConf(hn *node.HarnessNode,
return nil
}
desc := "has UTXOs:\n"
for _, utxo := range resp.Utxos {
desc += fmt.Sprintf("%v\n", utxo)
}
return errNumNotMatched(hn.Name(), "num of UTXOs",
expectedUtxos, total-old, total, old)
expectedUtxos, total-old, total, old, desc)
}, DefaultTimeout)
require.NoError(h, err, "timeout waiting for UTXOs")
+8 -2
View File
@@ -53,10 +53,16 @@ func CopyFile(dest, src string) error {
// errNumNotMatched is a helper method to return a nicely formatted error.
func errNumNotMatched(name string, subject string,
want, got, total, old int) error {
want, got, total, old int, desc ...any) error {
return fmt.Errorf("%s: assert %s failed: want %d, got: %d, total: "+
err := fmt.Errorf("%s: assert %s failed: want %d, got: %d, total: "+
"%d, previously had: %d", name, subject, want, got, total, old)
if len(desc) > 0 {
err = fmt.Errorf("%w, desc: %v", err, desc)
}
return err
}
// parseDerivationPath parses a path in the form of m/x'/y'/z'/a/b into a slice