Skip to content

Commit 17b125f

Browse files
authored
Merge pull request #1494 from lightninglabs/itest-postgres-flake
fix itest flake: allow AssertNonInteractiveRecvComplete more time to execute
2 parents 70b62f2 + 12fdc95 commit 17b125f

File tree

3 files changed

+12
-15
lines changed

3 files changed

+12
-15
lines changed

itest/assertions.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,13 +1240,13 @@ func AssertAssetOutboundTransferWithOutputs(t *testing.T,
12401240
func AssertNonInteractiveRecvComplete(t *testing.T,
12411241
receiver taprpc.TaprootAssetsClient, totalInboundTransfers int) {
12421242

1243-
ctxb := context.Background()
1244-
ctxt, cancel := context.WithTimeout(ctxb, defaultWaitTimeout)
1245-
defer cancel()
1246-
12471243
// And finally, they should be marked as completed with a proof
12481244
// available.
12491245
err := wait.NoError(func() error {
1246+
ctxb := context.Background()
1247+
ctxt, cancel := context.WithTimeout(ctxb, defaultWaitTimeout/2)
1248+
defer cancel()
1249+
12501250
resp, err := receiver.AddrReceives(
12511251
ctxt, &taprpc.AddrReceivesRequest{},
12521252
)
@@ -1265,7 +1265,7 @@ func AssertNonInteractiveRecvComplete(t *testing.T,
12651265
}
12661266

12671267
return nil
1268-
}, defaultWaitTimeout/2)
1268+
}, defaultWaitTimeout)
12691269
require.NoError(t, err)
12701270
}
12711271

itest/send_test.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -760,8 +760,7 @@ func testReattemptFailedSendHashmailCourier(t *harnessTest) {
760760
expectedEventCount := nodeBackoffCfg.NumTries - 1
761761

762762
// Context timeout scales with expected number of events.
763-
timeout := time.Duration(expectedEventCount) *
764-
defaultProofTransferReceiverAckTimeout
763+
timeout := time.Duration(expectedEventCount) * nodeBackoffCfg.MaxBackoff
765764

766765
// Allow for some margin for the operations that aren't pure
767766
// waiting on the receiver ACK.
@@ -868,8 +867,7 @@ func testReattemptProofTransferOnTapdRestart(t *harnessTest) {
868867
expectedEventCount := nodeBackoffCfg.NumTries - 1
869868

870869
// Context timeout scales with expected number of events.
871-
timeout := time.Duration(expectedEventCount) *
872-
defaultProofTransferReceiverAckTimeout
870+
timeout := time.Duration(expectedEventCount) * nodeBackoffCfg.MaxBackoff
873871

874872
// Allow for some margin for the operations that aren't pure waiting on
875873
// the receiver ACK.
@@ -1029,8 +1027,7 @@ func testReattemptFailedSendUniCourier(t *harnessTest) {
10291027
expectedEventCount := nodeBackoffCfg.NumTries - 1
10301028

10311029
// Context timeout scales with expected number of events.
1032-
timeout := time.Duration(expectedEventCount) *
1033-
defaultProofTransferReceiverAckTimeout
1030+
timeout := time.Duration(expectedEventCount) * nodeBackoffCfg.MaxBackoff
10341031

10351032
// Allow for some margin for the operations that aren't pure waiting on
10361033
// the receiver ACK.

itest/tapd_harness.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,19 @@ var (
5757
// for sending proofs with the hashmail courier.
5858
defaultHashmailBackoffConfig = proof.BackoffCfg{
5959
BackoffResetWait: time.Second,
60-
NumTries: 5,
60+
NumTries: 10,
6161
InitialBackoff: 300 * time.Millisecond,
62-
MaxBackoff: 600 * time.Millisecond,
62+
MaxBackoff: 2 * time.Second,
6363
}
6464

6565
// defaultUniverseRpcBackoffConfig is the default backoff config we'll
6666
// use for sending proofs with the universe RPC courier.
6767
defaultUniverseRpcBackoffConfig = proof.BackoffCfg{
6868
SkipInitDelay: true,
6969
BackoffResetWait: time.Second,
70-
NumTries: 5,
70+
NumTries: 10,
7171
InitialBackoff: 300 * time.Millisecond,
72-
MaxBackoff: 600 * time.Millisecond,
72+
MaxBackoff: 2 * time.Second,
7373
}
7474

7575
// defaultProofRetrievalDelay is the default delay we'll use for the

0 commit comments

Comments
 (0)