From 46cd7abf0c137d05243c95aa52d43a15a90a8d5f Mon Sep 17 00:00:00 2001 From: Rod Vagg Date: Wed, 1 Dec 2021 11:27:16 +1100 Subject: [PATCH 1/2] fix(test): increase 1s timeouts to 2s for slow CI --- impl/graphsync_test.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/impl/graphsync_test.go b/impl/graphsync_test.go index 0d32c959..24dbb67c 100644 --- a/impl/graphsync_test.go +++ b/impl/graphsync_test.go @@ -114,7 +114,7 @@ func TestMakeRequestToNetwork(t *testing.T) { func TestSendResponseToIncomingRequest(t *testing.T) { // create network ctx := context.Background() - ctx, cancel := context.WithTimeout(ctx, 1*time.Second) + ctx, cancel := context.WithTimeout(ctx, 2*time.Second) defer cancel() td := newGsTestData(ctx, t) r := &receiver{ @@ -182,7 +182,7 @@ func TestRejectRequestsByDefault(t *testing.T) { // create network ctx := context.Background() - ctx, cancel := context.WithTimeout(ctx, 1*time.Second) + ctx, cancel := context.WithTimeout(ctx, 2*time.Second) defer cancel() td := newGsTestData(ctx, t) @@ -216,7 +216,7 @@ func TestGraphsyncRoundTripRequestBudgetRequestor(t *testing.T) { // create network ctx := context.Background() - ctx, cancel := context.WithTimeout(ctx, 1*time.Second) + ctx, cancel := context.WithTimeout(ctx, 2*time.Second) defer cancel() td := newGsTestData(ctx, t) @@ -255,7 +255,7 @@ func TestGraphsyncRoundTripRequestBudgetResponder(t *testing.T) { // create network ctx := context.Background() - ctx, cancel := context.WithTimeout(ctx, 1*time.Second) + ctx, cancel := context.WithTimeout(ctx, 2*time.Second) defer cancel() td := newGsTestData(ctx, t) @@ -295,7 +295,7 @@ func TestGraphsyncRoundTrip(t *testing.T) { // create network ctx := context.Background() - ctx, cancel := context.WithTimeout(ctx, 1*time.Second) + ctx, cancel := context.WithTimeout(ctx, 2*time.Second) defer cancel() td := newGsTestData(ctx, t) @@ -367,7 +367,7 @@ func TestGraphsyncRoundTripPartial(t *testing.T) { // create network ctx := context.Background() - ctx, cancel := context.WithTimeout(ctx, 1*time.Second) + ctx, cancel := context.WithTimeout(ctx, 2*time.Second) defer cancel() td := newGsTestData(ctx, t) @@ -427,7 +427,7 @@ func TestGraphsyncRoundTripIgnoreCids(t *testing.T) { // create network ctx := context.Background() - ctx, cancel := context.WithTimeout(ctx, 1*time.Second) + ctx, cancel := context.WithTimeout(ctx, 2*time.Second) defer cancel() td := newGsTestData(ctx, t) @@ -860,7 +860,7 @@ func TestNetworkDisconnect(t *testing.T) { default: } }) - requestCtx, requestCancel := context.WithTimeout(ctx, 1*time.Second) + requestCtx, requestCancel := context.WithTimeout(ctx, 2*time.Second) defer requestCancel() progressChan, errChan := requestor.Request(requestCtx, td.host2.ID(), blockChain.TipLink, blockChain.Selector(), td.extension) @@ -908,7 +908,7 @@ func TestConnectFail(t *testing.T) { blockChainLength := 100 blockChain := testutil.SetupBlockChain(ctx, t, td.persistence2, 100, blockChainLength) - requestCtx, requestCancel := context.WithTimeout(ctx, 1*time.Second) + requestCtx, requestCancel := context.WithTimeout(ctx, 2*time.Second) defer requestCancel() // unlink peers so they cannot communicate @@ -946,7 +946,7 @@ func TestGraphsyncRoundTripAlternatePersistenceAndNodes(t *testing.T) { // create network ctx := context.Background() - ctx, cancel := context.WithTimeout(ctx, 1*time.Second) + ctx, cancel := context.WithTimeout(ctx, 2*time.Second) defer cancel() td := newGsTestData(ctx, t) @@ -1028,7 +1028,7 @@ func TestGraphsyncRoundTripMultipleAlternatePersistence(t *testing.T) { // create network ctx := context.Background() - ctx, cancel := context.WithTimeout(ctx, 1*time.Second) + ctx, cancel := context.WithTimeout(ctx, 2*time.Second) defer cancel() td := newGsTestData(ctx, t) @@ -1285,7 +1285,7 @@ func TestGraphsyncBlockListeners(t *testing.T) { // create network ctx := context.Background() - ctx, cancel := context.WithTimeout(ctx, 1*time.Second) + ctx, cancel := context.WithTimeout(ctx, 2*time.Second) defer cancel() td := newGsTestData(ctx, t) From 1abc46d4a424b3acfe2f7902427b9e9c6834641d Mon Sep 17 00:00:00 2001 From: Rod Vagg Date: Wed, 1 Dec 2021 11:50:56 +1100 Subject: [PATCH 2/2] fixup! fix(test): increase 1s timeouts to 2s for slow CI --- impl/graphsync_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/impl/graphsync_test.go b/impl/graphsync_test.go index 24dbb67c..ae651d86 100644 --- a/impl/graphsync_test.go +++ b/impl/graphsync_test.go @@ -860,7 +860,7 @@ func TestNetworkDisconnect(t *testing.T) { default: } }) - requestCtx, requestCancel := context.WithTimeout(ctx, 2*time.Second) + requestCtx, requestCancel := context.WithTimeout(ctx, 1*time.Second) defer requestCancel() progressChan, errChan := requestor.Request(requestCtx, td.host2.ID(), blockChain.TipLink, blockChain.Selector(), td.extension) @@ -908,7 +908,7 @@ func TestConnectFail(t *testing.T) { blockChainLength := 100 blockChain := testutil.SetupBlockChain(ctx, t, td.persistence2, 100, blockChainLength) - requestCtx, requestCancel := context.WithTimeout(ctx, 2*time.Second) + requestCtx, requestCancel := context.WithTimeout(ctx, 1*time.Second) defer requestCancel() // unlink peers so they cannot communicate