Merge pull request #1138 from halseth/integration-test-remove-block-flake
Integration tests: remove racy block generation
This commit is contained in:
commit
09c9979831
11
lnd_test.go
11
lnd_test.go
@ -6957,7 +6957,7 @@ func testMultHopRemoteForceCloseOnChainHtlcTimeout(net *lntest.NetworkHarness,
|
|||||||
t.Fatalf("unable to send alice htlc: %v", err)
|
t.Fatalf("unable to send alice htlc: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Once the HTLC has cleared, all the nodes n our mini network should
|
// Once the HTLC has cleared, all the nodes in our mini network should
|
||||||
// show that the HTLC has been locked in.
|
// show that the HTLC has been locked in.
|
||||||
var predErr error
|
var predErr error
|
||||||
nodes := []*lntest.HarnessNode{net.Alice, net.Bob, carol}
|
nodes := []*lntest.HarnessNode{net.Alice, net.Bob, carol}
|
||||||
@ -7004,7 +7004,8 @@ func testMultHopRemoteForceCloseOnChainHtlcTimeout(net *lntest.NetworkHarness,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Next, we'll mine enough blocks for the HTLC to expire. At this
|
// Next, we'll mine enough blocks for the HTLC to expire. At this
|
||||||
// point, Bob should hand off the output to his internal utxo nursery.
|
// point, Bob should hand off the output to his internal utxo nursery,
|
||||||
|
// which will broadcast a sweep transaction.
|
||||||
if _, err := net.Miner.Node.Generate(finalCltvDelta - 1); err != nil {
|
if _, err := net.Miner.Node.Generate(finalCltvDelta - 1); err != nil {
|
||||||
t.Fatalf("unable to generate blocks: %v", err)
|
t.Fatalf("unable to generate blocks: %v", err)
|
||||||
}
|
}
|
||||||
@ -7046,12 +7047,6 @@ func testMultHopRemoteForceCloseOnChainHtlcTimeout(net *lntest.NetworkHarness,
|
|||||||
t.Fatalf("bob didn't hand off time-locked HTLC: %v", predErr)
|
t.Fatalf("bob didn't hand off time-locked HTLC: %v", predErr)
|
||||||
}
|
}
|
||||||
|
|
||||||
// We'll now mine an additional block to push the HTLC to full
|
|
||||||
// expiration.
|
|
||||||
if _, err := net.Miner.Node.Generate(1); err != nil {
|
|
||||||
t.Fatalf("unable to generate block: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Bob's sweeping transaction should now be found in the mempool at
|
// Bob's sweeping transaction should now be found in the mempool at
|
||||||
// this point.
|
// this point.
|
||||||
_, err = waitForTxInMempool(net.Miner.Node, time.Second*20)
|
_, err = waitForTxInMempool(net.Miner.Node, time.Second*20)
|
||||||
|
Loading…
Reference in New Issue
Block a user