Merge pull request #1138 from halseth/integration-test-remove-block-flake

Integration tests: remove racy block generation
This commit is contained in:
Olaoluwa Osuntokun 2018-04-27 13:19:39 -07:00 committed by GitHub
commit 09c9979831
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -6957,7 +6957,7 @@ func testMultHopRemoteForceCloseOnChainHtlcTimeout(net *lntest.NetworkHarness,
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.
var predErr error
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
// 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 {
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)
}
// 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
// this point.
_, err = waitForTxInMempool(net.Miner.Node, time.Second*20)