Skip to content

Commit

Permalink
itest: save about 40 seconds in itest
Browse files Browse the repository at this point in the history
By reducing the hashmail proof receiver ACK timeout from 15 seconds to 5
seconds, we can save quite some time during the integration tests.
  • Loading branch information
guggero committed Jan 4, 2024
1 parent 640cb7f commit f5937f0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions itest/send_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ import (
"github.com/stretchr/testify/require"
)

var (
transferTypeSend = taprpc.ProofTransferType_PROOF_TRANSFER_TYPE_SEND
)

// testBasicSendUnidirectional tests that we can properly send assets back and
// forth between nodes.
func testBasicSendUnidirectional(t *harnessTest) {
Expand Down Expand Up @@ -619,7 +623,7 @@ func testReattemptFailedSendHashmailCourier(t *harnessTest) {
switch eventTyped := event.Event.(type) {
case *taprpc.SendAssetEvent_ProofTransferBackoffWaitEvent:
ev := eventTyped.ProofTransferBackoffWaitEvent
if ev.TransferType != taprpc.ProofTransferType_PROOF_TRANSFER_TYPE_SEND {
if ev.TransferType != transferTypeSend {
return false
}

Expand Down Expand Up @@ -726,7 +730,7 @@ func testReattemptFailedSendUniCourier(t *harnessTest) {
switch eventTyped := event.Event.(type) {
case *taprpc.SendAssetEvent_ProofTransferBackoffWaitEvent:
ev := eventTyped.ProofTransferBackoffWaitEvent
if ev.TransferType != taprpc.ProofTransferType_PROOF_TRANSFER_TYPE_SEND {
if ev.TransferType != transferTypeSend {
return false
}

Expand Down Expand Up @@ -1000,7 +1004,7 @@ func testOfflineReceiverEventuallyReceives(t *harnessTest) {
// node. We therefore expect to receive
// deliver transfer type backoff wait events
// for sending transfers.
if ev.TransferType != taprpc.ProofTransferType_PROOF_TRANSFER_TYPE_SEND {
if ev.TransferType != transferTypeSend {
return false
}

Expand Down
2 changes: 1 addition & 1 deletion itest/tapd_harness.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const (
// defaultProofTransferReceiverAckTimeout is the default itest specific
// timeout we'll use for waiting for a receiver to acknowledge a proof
// transfer.
defaultProofTransferReceiverAckTimeout = 15 * time.Second
defaultProofTransferReceiverAckTimeout = 5 * time.Second
)

// tapdHarness is a test harness that holds everything that is needed to
Expand Down

0 comments on commit f5937f0

Please sign in to comment.