diff --git a/lntest/itest/lnd_test.go b/lntest/itest/lnd_test.go index d3a86d4f..fcf21ea0 100644 --- a/lntest/itest/lnd_test.go +++ b/lntest/itest/lnd_test.go @@ -11787,7 +11787,15 @@ func testSwitchOfflineDelivery(net *lntest.NetworkHarness, t *harnessTest) { err) } - time.Sleep(time.Millisecond * 50) + // Make sure all nodes are fully synced before we continue. + ctxt, cancel := context.WithTimeout(ctxb, defaultTimeout) + defer cancel() + for _, node := range nodes { + err := node.WaitForBlockchainSync(ctxt) + if err != nil { + t.Fatalf("unable to wait for sync: %v", err) + } + } // Using Carol as the source, pay to the 5 invoices from Bob created // above. @@ -11856,6 +11864,16 @@ func testSwitchOfflineDelivery(net *lntest.NetworkHarness, t *harnessTest) { t.Fatalf("htlc mismatch: %v", predErr) } + // Make sure all nodes are fully synced again. + ctxt, cancel = context.WithTimeout(ctxb, defaultTimeout) + defer cancel() + for _, node := range nodes { + err := node.WaitForBlockchainSync(ctxt) + if err != nil { + t.Fatalf("unable to wait for sync: %v", err) + } + } + // Now that the settles have reached Dave, reconnect him with Alice, // allowing the settles to return to the sender. ctxt, _ = context.WithTimeout(ctxb, defaultTimeout) diff --git a/lntest/itest/log_error_whitelist.txt b/lntest/itest/log_error_whitelist.txt index 2496b070..665b3266 100644 --- a/lntest/itest/log_error_whitelist.txt +++ b/lntest/itest/log_error_whitelist.txt @@ -155,6 +155,7 @@