From 9e5f1c035e3bc01ca5d1f273b7fc8f82ac2c5557 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Mon, 4 Mar 2024 12:29:10 +0100 Subject: [PATCH] itest: further reduce itest run time We fix some additional issues of long-running (>10 seconds) integration tests. --- itest/assertions.go | 4 ++-- itest/universe_federation_test.go | 4 ++-- itest/universe_pagination_test.go | 10 ++++------ 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/itest/assertions.go b/itest/assertions.go index 98abd825e..8234c54e9 100644 --- a/itest/assertions.go +++ b/itest/assertions.go @@ -1717,8 +1717,8 @@ func assertGroups(t *testing.T, client taprpc.TaprootAssetsClient, // assetRoots is a helper method that fetches all roots from a given universe // rpc by scanning for all pages. -func assetRoots(ctx context.Context, - uni unirpc.UniverseClient, pageSize int32) (*unirpc.AssetRootResponse, error) { +func assetRoots(ctx context.Context, uni unirpc.UniverseClient, + pageSize int32) (*unirpc.AssetRootResponse, error) { offset := int32(0) roots := make(map[string]*unirpc.UniverseRoot) diff --git a/itest/universe_federation_test.go b/itest/universe_federation_test.go index 69d7dd712..b4325b850 100644 --- a/itest/universe_federation_test.go +++ b/itest/universe_federation_test.go @@ -14,10 +14,10 @@ import ( // node is offline at the time of the initial sync attempt. func testMintProofRepeatFedSyncAttempt(t *harnessTest) { // Create a new minting node, without hooking it up to any existing - // Universe server. We will also set the sync ticker to 4 second, so + // Universe server. We will also set the sync ticker to 2 second, so // that we can test that the proof push sync is retried and eventually // succeeds after the fed server peer node reappears online. - syncTickerInterval := 4 * time.Second + syncTickerInterval := 2 * time.Second mintingNode := setupTapdHarness( t.t, t, t.lndHarness.Bob, nil, func(params *tapdHarnessParams) { diff --git a/itest/universe_pagination_test.go b/itest/universe_pagination_test.go index 9ef4c1065..614f775bf 100644 --- a/itest/universe_pagination_test.go +++ b/itest/universe_pagination_test.go @@ -22,7 +22,7 @@ const ( // testPageSizeSmall is the page size to use when fetching data from the // universe rpc. We use a small page size to test pagination. - testPageSizeSmall = 2 + testPageSizeSmall = 10 // testGroupSize is the size of the asset group we mint in the // testUniversePaginationSimple test. @@ -30,7 +30,7 @@ const ( ) func testUniversePaginationSimple(t *harnessTest) { - mintSize := 255 + mintSize := 50 timeout := defaultWaitTimeout // If we create a second tapd instance and sync the universe state, @@ -211,10 +211,8 @@ func mintBatchAssetsTest( require.NoError(t, err) require.Eventually(t, func() bool { - return AssertUniverseStateEqual( - t, alice, bob, - ) - }, minterTimeout, time.Second) + return AssertUniverseStateEqual(t, alice, bob) + }, minterTimeout, 200*time.Millisecond) } // fetchAllLeafKeys fetches all leaf keys for a given universe ID.