itest: fix timeout in sign_psbt test

This commit is contained in:
Oliver Gugger 2022-07-08 14:30:04 +02:00
parent 9fd9234d86
commit 989648b7ec
No known key found for this signature in database
GPG key ID: 8E4256593F177720

View file

@ -468,7 +468,7 @@ func testPsbtChanFundingSingleStep(net *lntest.NetworkHarness, t *harnessTest) {
// Everything we do here should be done within a second or two, so we
// can just keep a single timeout context around for all calls.
ctxt, cancel := context.WithTimeout(ctxb, defaultTimeout)
ctxt, cancel := context.WithTimeout(ctxb, 2*defaultTimeout)
defer cancel()
args := nodeArgsForCommitType(lnrpc.CommitmentType_ANCHORS)
@ -1019,8 +1019,6 @@ func runSignPsbtSegWitV1ScriptSpend(t *harnessTest,
func runFundAndSignPsbt(t *harnessTest, net *lntest.NetworkHarness,
alice *lntest.HarnessNode) {
// Everything we do here should be done within a second or two, so we
// can just keep a single timeout context around for all calls.
ctxb := context.Background()
ctxt, cancel := context.WithTimeout(ctxb, defaultTimeout)
defer cancel()
@ -1042,6 +1040,8 @@ func runFundAndSignPsbt(t *harnessTest, net *lntest.NetworkHarness,
}
for _, addrType := range spendAddrTypes {
ctxt, cancel := context.WithTimeout(ctxb, defaultTimeout)
// First, spend all the coins in the wallet to an address of the
// given type so that UTXO will be picked when funding a PSBT.
sendAllCoinsToAddrType(ctxt, t, net, alice, addrType)
@ -1057,6 +1057,8 @@ func runFundAndSignPsbt(t *harnessTest, net *lntest.NetworkHarness,
// is calling FinalizePsbt directly, also works for this address
// type.
assertPsbtFundSignSpend(ctxt, t, net, alice, fundOutputs, true)
cancel()
}
}