lntest: wait for chain sync in switch test

This commit is contained in:
Oliver Gugger 2021-05-07 19:11:22 +02:00
parent ea4ef204a0
commit 8147b270d4
No known key found for this signature in database
GPG Key ID: 8E4256593F177720
3 changed files with 21 additions and 2 deletions

View File

@ -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)

View File

@ -155,6 +155,7 @@
<time> [ERR] NTFN: unable to get hash from block with height 790
<time> [ERR] NTFN: unable to get missed blocks: starting height <height> is greater than ending height <height>
<time> [ERR] NTFN: Unable to rewind chain from height <height> to height <height>: unable to find blockhash for disconnected height=<height>: -1: Block number out of range
<time> [ERR] NTFN: Unable to rewind chain from height <height> to height <height>: unable to find blockhash for disconnected height=<height>: -8: Block height out of range
<time> [ERR] NTNF: unable to get hash from block with height <height>
<time> [ERR] PEER: Allowed test error from <ip> (inbound): ReadMessage: unhandled command [sendaddrv2]
<time> [ERR] PEER: resend failed: unable to fetch channel sync messages for peer <hex>@<ip>: unable to find closed channel summary

View File

@ -10,7 +10,7 @@ s/HTLC ID = [[:digit:]]+/HTLC ID = <id>/g
s/height=[[:digit:]]+/height=<height>/g
s/collecting result for shard [[:digit:]]+/collecting result for shard <number>/g
s/sending attempt [[:digit:]]+/sending attempt <number>/g
s/Unable to rewind chain from height [[:digit:]]+ to height [[:digit:]]+/Unable to rewind chain from height <height> to height <height>/g
s/Unable to rewind chain from height [[:digit:]]+ to height -?[[:digit:]]+/Unable to rewind chain from height <height> to height <height>/g
s/NTFN: unable to get missed blocks: starting height [[:digit:]]+ is greater than ending height [[:digit:]]+/NTFN: unable to get missed blocks: starting height <height> is greater than ending height <height>/g
s/BTCN: Broadcast attempt failed: rejected by <ip>: replacement transaction <hex> has an insufficient fee rate: needs more than [[:digit:]]+, has [[:digit:]]+/BTCN: Broadcast attempt failed: rejected by <ip>: replacement transaction <hex> has an insufficient fee rate: needs more than <amt>, has <amt>/g
s/pid=[[:digit:]]+/pid=<pid>/g