From 69933c3dd08968de01696bf29446e0354c1cddd2 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Mon, 19 Jun 2023 23:55:24 +0800 Subject: [PATCH] parallel tests --- .golangci.yml | 2 ++ cmd/build_test_matrix/main_test.go | 8 ++++++++ internal/collections/collections_test.go | 2 ++ .../controller/ibc_middleware_test.go | 1 + .../controller/keeper/keeper_test.go | 1 + .../controller/migrations/v6/migrations_test.go | 1 + .../controller/types/msgs_test.go | 4 ++++ .../host/client/cli/tx_test.go | 2 ++ .../27-interchain-accounts/host/ibc_module_test.go | 1 + .../host/keeper/keeper_test.go | 1 + .../27-interchain-accounts/host/types/msgs_test.go | 4 ++++ .../27-interchain-accounts/host/types/params_test.go | 1 + modules/apps/27-interchain-accounts/module_test.go | 1 + .../simulation/decoder_test.go | 2 ++ .../simulation/genesis_test.go | 1 + .../27-interchain-accounts/types/account_test.go | 1 + modules/apps/29-fee/fee_test.go | 1 + modules/apps/29-fee/keeper/keeper_test.go | 1 + modules/apps/29-fee/types/fee_test.go | 2 ++ modules/apps/29-fee/types/genesis_test.go | 2 ++ modules/apps/29-fee/types/keys_test.go | 8 ++++++++ modules/apps/29-fee/types/msgs_test.go | 12 ++++++++++++ modules/apps/transfer/keeper/keeper_test.go | 1 + modules/apps/transfer/simulation/decoder_test.go | 2 ++ modules/apps/transfer/simulation/genesis_test.go | 2 ++ modules/apps/transfer/transfer_test.go | 1 + modules/apps/transfer/types/genesis_test.go | 1 + modules/apps/transfer/types/keys_test.go | 1 + modules/apps/transfer/types/msgs_test.go | 6 ++++++ modules/apps/transfer/types/packet_test.go | 1 + modules/apps/transfer/types/trace_test.go | 6 ++++++ modules/apps/transfer/types/types_test.go | 1 + modules/core/02-client/abci_test.go | 1 + modules/core/02-client/keeper/keeper_test.go | 1 + modules/core/02-client/migrations/v7/store_test.go | 1 + modules/core/02-client/simulation/decoder_test.go | 2 ++ modules/core/02-client/types/client_test.go | 1 + modules/core/02-client/types/height_test.go | 6 ++++++ modules/core/02-client/types/keys_test.go | 2 ++ modules/core/02-client/types/msgs_test.go | 1 + modules/core/02-client/types/params_test.go | 2 ++ modules/core/03-connection/keeper/keeper_test.go | 1 + .../core/03-connection/simulation/decoder_test.go | 2 ++ modules/core/03-connection/types/connection_test.go | 3 +++ modules/core/03-connection/types/genesis_test.go | 1 + modules/core/03-connection/types/keys_test.go | 1 + modules/core/03-connection/types/msgs_test.go | 1 + modules/core/03-connection/types/params_test.go | 1 + modules/core/03-connection/types/version_test.go | 6 ++++++ modules/core/04-channel/keeper/keeper_test.go | 1 + modules/core/04-channel/simulation/decoder_test.go | 2 ++ modules/core/04-channel/types/channel_test.go | 2 ++ modules/core/04-channel/types/genesis_test.go | 1 + modules/core/04-channel/types/keys_test.go | 1 + modules/core/04-channel/types/msgs_test.go | 1 + modules/core/04-channel/types/packet_test.go | 2 ++ modules/core/05-port/keeper/keeper_test.go | 1 + modules/core/23-commitment/types/commitment_test.go | 1 + modules/core/23-commitment/types/merkle_test.go | 2 ++ modules/core/24-host/parse_test.go | 2 ++ modules/core/24-host/validate_test.go | 4 ++++ modules/core/ante/ante_test.go | 1 + modules/core/genesis_test.go | 1 + modules/core/keeper/keeper_test.go | 1 + modules/core/migrations/v7/genesis_test.go | 1 + modules/core/simulation/decoder_test.go | 2 ++ modules/core/simulation/genesis_test.go | 1 + .../light-clients/06-solomachine/solomachine_test.go | 3 +++ .../07-tendermint/migrations/migrations_test.go | 1 + .../light-clients/07-tendermint/tendermint_test.go | 1 + modules/light-clients/09-localhost/localhost_test.go | 1 + testing/chain_test.go | 1 + testing/mock/ibc_module_test.go | 1 + testing/mock/privval_test.go | 3 +++ testing/simapp/genesis_account_test.go | 2 ++ testing/simapp/sim_test.go | 4 ++++ testing/simapp/simd/cmd/cmd_test.go | 2 ++ testing/simapp/testutil_network_test.go | 1 + 78 files changed, 161 insertions(+) diff --git a/.golangci.yml b/.golangci.yml index 98e1babadbe..269cb3a94de 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -18,7 +18,9 @@ linters: - ineffassign - misspell - nakedret + - paralleltest - staticcheck + - tparallel - thelper - stylecheck - revive diff --git a/cmd/build_test_matrix/main_test.go b/cmd/build_test_matrix/main_test.go index 67a8fde26f8..a1e8d412fea 100644 --- a/cmd/build_test_matrix/main_test.go +++ b/cmd/build_test_matrix/main_test.go @@ -17,13 +17,16 @@ const ( ) func TestGetGithubActionMatrixForTests(t *testing.T) { + t.Parallel() t.Run("empty dir does not fail", func(t *testing.T) { + t.Parallel() testingDir := t.TempDir() _, err := getGithubActionMatrixForTests(testingDir, "", "", nil) assert.NoError(t, err) }) t.Run("only test functions are picked up", func(t *testing.T) { + t.Parallel() testingDir := t.TempDir() createFileWithTestSuiteAndTests(t, "FeeMiddlewareTestSuite", "TestA", "TestB", testingDir, goTestFileNameOne) @@ -46,6 +49,7 @@ func TestGetGithubActionMatrixForTests(t *testing.T) { }) t.Run("all files are picked up", func(t *testing.T) { + t.Parallel() testingDir := t.TempDir() createFileWithTestSuiteAndTests(t, "FeeMiddlewareTestSuite", "TestA", "TestB", testingDir, goTestFileNameOne) createFileWithTestSuiteAndTests(t, "TransferTestSuite", "TestC", "TestD", testingDir, goTestFileNameTwo) @@ -78,6 +82,7 @@ func TestGetGithubActionMatrixForTests(t *testing.T) { }) t.Run("single test can be specified", func(t *testing.T) { + t.Parallel() testingDir := t.TempDir() createFileWithTestSuiteAndTests(t, "FeeMiddlewareTestSuite", "TestA", "TestB", testingDir, goTestFileNameOne) createFileWithTestSuiteAndTests(t, "TransferTestSuite", "TestC", "TestD", testingDir, goTestFileNameTwo) @@ -98,6 +103,7 @@ func TestGetGithubActionMatrixForTests(t *testing.T) { }) t.Run("error if single test doesn't exist", func(t *testing.T) { + t.Parallel() testingDir := t.TempDir() createFileWithTestSuiteAndTests(t, "FeeMiddlewareTestSuite", "TestA", "TestB", testingDir, goTestFileNameOne) @@ -106,6 +112,7 @@ func TestGetGithubActionMatrixForTests(t *testing.T) { }) t.Run("non test files are not picked up", func(t *testing.T) { + t.Parallel() testingDir := t.TempDir() createFileWithTestSuiteAndTests(t, "FeeMiddlewareTestSuite", "TestA", "TestB", testingDir, nonTestFile) @@ -115,6 +122,7 @@ func TestGetGithubActionMatrixForTests(t *testing.T) { }) t.Run("fails when there are multiple suite runs", func(t *testing.T) { + t.Parallel() testingDir := t.TempDir() createFileWithTestSuiteAndTests(t, "FeeMiddlewareTestSuite", "TestA", "TestB", testingDir, nonTestFile) diff --git a/internal/collections/collections_test.go b/internal/collections/collections_test.go index faf16fa6bc3..888d249d28c 100644 --- a/internal/collections/collections_test.go +++ b/internal/collections/collections_test.go @@ -8,6 +8,7 @@ import ( ) func TestContainsString(t *testing.T) { + t.Parallel() testCases := []struct { name string haystack []string @@ -26,6 +27,7 @@ func TestContainsString(t *testing.T) { } func TestContainsInt(t *testing.T) { + t.Parallel() testCases := []struct { name string haystack []int diff --git a/modules/apps/27-interchain-accounts/controller/ibc_middleware_test.go b/modules/apps/27-interchain-accounts/controller/ibc_middleware_test.go index 663a72b6dcc..141d7886cca 100644 --- a/modules/apps/27-interchain-accounts/controller/ibc_middleware_test.go +++ b/modules/apps/27-interchain-accounts/controller/ibc_middleware_test.go @@ -48,6 +48,7 @@ type InterchainAccountsTestSuite struct { } func TestICATestSuite(t *testing.T) { + t.Parallel() suite.Run(t, new(InterchainAccountsTestSuite)) } diff --git a/modules/apps/27-interchain-accounts/controller/keeper/keeper_test.go b/modules/apps/27-interchain-accounts/controller/keeper/keeper_test.go index e5d444973e5..b65f2457099 100644 --- a/modules/apps/27-interchain-accounts/controller/keeper/keeper_test.go +++ b/modules/apps/27-interchain-accounts/controller/keeper/keeper_test.go @@ -99,6 +99,7 @@ func RegisterInterchainAccount(endpoint *ibctesting.Endpoint, owner string) erro } func TestKeeperTestSuite(t *testing.T) { + t.Parallel() suite.Run(t, new(KeeperTestSuite)) } diff --git a/modules/apps/27-interchain-accounts/controller/migrations/v6/migrations_test.go b/modules/apps/27-interchain-accounts/controller/migrations/v6/migrations_test.go index a363c7e3f57..39d943b7830 100644 --- a/modules/apps/27-interchain-accounts/controller/migrations/v6/migrations_test.go +++ b/modules/apps/27-interchain-accounts/controller/migrations/v6/migrations_test.go @@ -80,6 +80,7 @@ func (suite *MigrationsTestSuite) RegisterInterchainAccount(endpoint *ibctesting } func TestKeeperTestSuite(t *testing.T) { + t.Parallel() suite.Run(t, new(MigrationsTestSuite)) } diff --git a/modules/apps/27-interchain-accounts/controller/types/msgs_test.go b/modules/apps/27-interchain-accounts/controller/types/msgs_test.go index e5388db027d..7057802367e 100644 --- a/modules/apps/27-interchain-accounts/controller/types/msgs_test.go +++ b/modules/apps/27-interchain-accounts/controller/types/msgs_test.go @@ -20,6 +20,7 @@ import ( ) func TestMsgRegisterInterchainAccountValidateBasic(t *testing.T) { + t.Parallel() var msg *types.MsgRegisterInterchainAccount testCases := []struct { @@ -88,6 +89,7 @@ func TestMsgRegisterInterchainAccountValidateBasic(t *testing.T) { } func TestMsgRegisterInterchainAccountGetSigners(t *testing.T) { + t.Parallel() expSigner, err := sdk.AccAddressFromBech32(ibctesting.TestAccAddress) require.NoError(t, err) @@ -96,6 +98,7 @@ func TestMsgRegisterInterchainAccountGetSigners(t *testing.T) { } func TestMsgSendTxValidateBasic(t *testing.T) { + t.Parallel() var msg *types.MsgSendTx testCases := []struct { @@ -181,6 +184,7 @@ func TestMsgSendTxValidateBasic(t *testing.T) { } func TestMsgSendTxGetSigners(t *testing.T) { + t.Parallel() expSigner, err := sdk.AccAddressFromBech32(ibctesting.TestAccAddress) require.NoError(t, err) diff --git a/modules/apps/27-interchain-accounts/host/client/cli/tx_test.go b/modules/apps/27-interchain-accounts/host/client/cli/tx_test.go index fc2f1608dd3..dfd76a0974e 100644 --- a/modules/apps/27-interchain-accounts/host/client/cli/tx_test.go +++ b/modules/apps/27-interchain-accounts/host/client/cli/tx_test.go @@ -39,6 +39,7 @@ const bankSendMessage = `{ var multiMsg = fmt.Sprintf("[ %s, %s ]", msgDelegateMessage, bankSendMessage) func TestGeneratePacketData(t *testing.T) { + t.Parallel() t.Helper() tests := []struct { name string @@ -110,6 +111,7 @@ func TestGeneratePacketData(t *testing.T) { cdc := codec.NewProtoCodec(ir) t.Run(tc.name, func(t *testing.T) { + t.Parallel() bz, err := generatePacketData(cdc, []byte(tc.message), tc.memo) if tc.expectedPass { diff --git a/modules/apps/27-interchain-accounts/host/ibc_module_test.go b/modules/apps/27-interchain-accounts/host/ibc_module_test.go index f8737c300a2..59190c2a7a6 100644 --- a/modules/apps/27-interchain-accounts/host/ibc_module_test.go +++ b/modules/apps/27-interchain-accounts/host/ibc_module_test.go @@ -49,6 +49,7 @@ type InterchainAccountsTestSuite struct { } func TestICATestSuite(t *testing.T) { + t.Parallel() suite.Run(t, new(InterchainAccountsTestSuite)) } diff --git a/modules/apps/27-interchain-accounts/host/keeper/keeper_test.go b/modules/apps/27-interchain-accounts/host/keeper/keeper_test.go index 71854cbbe16..810ab2d3c8e 100644 --- a/modules/apps/27-interchain-accounts/host/keeper/keeper_test.go +++ b/modules/apps/27-interchain-accounts/host/keeper/keeper_test.go @@ -100,6 +100,7 @@ func RegisterInterchainAccount(endpoint *ibctesting.Endpoint, owner string) erro } func TestKeeperTestSuite(t *testing.T) { + t.Parallel() suite.Run(t, new(KeeperTestSuite)) } diff --git a/modules/apps/27-interchain-accounts/host/types/msgs_test.go b/modules/apps/27-interchain-accounts/host/types/msgs_test.go index ede00f761ff..820f0390250 100644 --- a/modules/apps/27-interchain-accounts/host/types/msgs_test.go +++ b/modules/apps/27-interchain-accounts/host/types/msgs_test.go @@ -9,6 +9,7 @@ import ( ) func TestMsgUpdateParamsValidateBasic(t *testing.T) { + t.Parallel() var msg *types.MsgUpdateParams testCases := []struct { @@ -50,7 +51,9 @@ func TestMsgUpdateParamsValidateBasic(t *testing.T) { } for _, tc := range testCases { + tc := tc t.Run(tc.name, func(t *testing.T) { + t.Parallel() tc.malleate() err := msg.ValidateBasic() @@ -64,6 +67,7 @@ func TestMsgUpdateParamsValidateBasic(t *testing.T) { } func TestMsgUpdateParamsGetSigners(t *testing.T) { + t.Parallel() authority := sdk.AccAddress("authority") msg := types.MsgUpdateParams{ Authority: authority.String(), diff --git a/modules/apps/27-interchain-accounts/host/types/params_test.go b/modules/apps/27-interchain-accounts/host/types/params_test.go index 81bb547f473..c95ef5f2aab 100644 --- a/modules/apps/27-interchain-accounts/host/types/params_test.go +++ b/modules/apps/27-interchain-accounts/host/types/params_test.go @@ -9,6 +9,7 @@ import ( ) func TestValidateParams(t *testing.T) { + t.Parallel() require.NoError(t, types.DefaultParams().Validate()) require.NoError(t, types.NewParams(false, []string{}).Validate()) require.Error(t, types.NewParams(true, []string{""}).Validate()) diff --git a/modules/apps/27-interchain-accounts/module_test.go b/modules/apps/27-interchain-accounts/module_test.go index 3343e358a38..f435327be41 100644 --- a/modules/apps/27-interchain-accounts/module_test.go +++ b/modules/apps/27-interchain-accounts/module_test.go @@ -24,6 +24,7 @@ type InterchainAccountsTestSuite struct { } func TestICATestSuite(t *testing.T) { + t.Parallel() suite.Run(t, new(InterchainAccountsTestSuite)) } diff --git a/modules/apps/27-interchain-accounts/simulation/decoder_test.go b/modules/apps/27-interchain-accounts/simulation/decoder_test.go index 81e899b620e..b2d9e53bf38 100644 --- a/modules/apps/27-interchain-accounts/simulation/decoder_test.go +++ b/modules/apps/27-interchain-accounts/simulation/decoder_test.go @@ -13,6 +13,7 @@ import ( ) func TestDecodeStore(t *testing.T) { + t.Parallel() var ( owner = "owner" channelID = ibctesting.FirstChannelID @@ -54,6 +55,7 @@ func TestDecodeStore(t *testing.T) { for i, tt := range tests { i, tt := i, tt t.Run(tt.name, func(t *testing.T) { + t.Parallel() if i == len(tests)-1 { require.Panics(t, func() { dec(kvPairs.Pairs[i], kvPairs.Pairs[i]) }, tt.name) } else { diff --git a/modules/apps/27-interchain-accounts/simulation/genesis_test.go b/modules/apps/27-interchain-accounts/simulation/genesis_test.go index ac38cc936c4..a19970399b7 100644 --- a/modules/apps/27-interchain-accounts/simulation/genesis_test.go +++ b/modules/apps/27-interchain-accounts/simulation/genesis_test.go @@ -21,6 +21,7 @@ import ( // TestRandomizedGenState tests the normal scenario of applying RandomizedGenState. // Abonormal scenarios are not tested here. func TestRandomizedGenState(t *testing.T) { + t.Parallel() interfaceRegistry := codectypes.NewInterfaceRegistry() cryptocodec.RegisterInterfaces(interfaceRegistry) cdc := codec.NewProtoCodec(interfaceRegistry) diff --git a/modules/apps/27-interchain-accounts/types/account_test.go b/modules/apps/27-interchain-accounts/types/account_test.go index 8acef7e33a9..9866761ccd8 100644 --- a/modules/apps/27-interchain-accounts/types/account_test.go +++ b/modules/apps/27-interchain-accounts/types/account_test.go @@ -39,6 +39,7 @@ func (suite *TypesTestSuite) SetupTest() { } func TestTypesTestSuite(t *testing.T) { + t.Parallel() suite.Run(t, new(TypesTestSuite)) } diff --git a/modules/apps/29-fee/fee_test.go b/modules/apps/29-fee/fee_test.go index 0505a186132..00cd6c4a71c 100644 --- a/modules/apps/29-fee/fee_test.go +++ b/modules/apps/29-fee/fee_test.go @@ -48,6 +48,7 @@ func (suite *FeeTestSuite) SetupTest() { } func TestIBCFeeTestSuite(t *testing.T) { + t.Parallel() suite.Run(t, new(FeeTestSuite)) } diff --git a/modules/apps/29-fee/keeper/keeper_test.go b/modules/apps/29-fee/keeper/keeper_test.go index 26a573042b7..894faa613fe 100644 --- a/modules/apps/29-fee/keeper/keeper_test.go +++ b/modules/apps/29-fee/keeper/keeper_test.go @@ -57,6 +57,7 @@ func (suite *KeeperTestSuite) SetupTest() { } func TestKeeperTestSuite(t *testing.T) { + t.Parallel() suite.Run(t, new(KeeperTestSuite)) } diff --git a/modules/apps/29-fee/types/fee_test.go b/modules/apps/29-fee/types/fee_test.go index 5c8800f2913..32430167e9a 100644 --- a/modules/apps/29-fee/types/fee_test.go +++ b/modules/apps/29-fee/types/fee_test.go @@ -30,6 +30,7 @@ var ( const invalidAddress = "invalid-address" func TestFeeTotal(t *testing.T) { + t.Parallel() fee := types.NewFee(defaultRecvFee, defaultAckFee, defaultTimeoutFee) total := fee.Total() @@ -37,6 +38,7 @@ func TestFeeTotal(t *testing.T) { } func TestPacketFeeValidation(t *testing.T) { + t.Parallel() var packetFee types.PacketFee testCases := []struct { diff --git a/modules/apps/29-fee/types/genesis_test.go b/modules/apps/29-fee/types/genesis_test.go index 6ecde68c3a6..dbe5bba6b1f 100644 --- a/modules/apps/29-fee/types/genesis_test.go +++ b/modules/apps/29-fee/types/genesis_test.go @@ -13,11 +13,13 @@ import ( ) func TestValidateDefaultGenesis(t *testing.T) { + t.Parallel() err := types.DefaultGenesisState().Validate() require.NoError(t, err) } func TestValidateGenesis(t *testing.T) { + t.Parallel() var genState *types.GenesisState testCases := []struct { diff --git a/modules/apps/29-fee/types/keys_test.go b/modules/apps/29-fee/types/keys_test.go index d9965c4bf98..151ab0e78a7 100644 --- a/modules/apps/29-fee/types/keys_test.go +++ b/modules/apps/29-fee/types/keys_test.go @@ -14,11 +14,13 @@ import ( var validPacketID = channeltypes.NewPacketID(ibctesting.MockFeePort, ibctesting.FirstChannelID, 1) func TestKeyPayee(t *testing.T) { + t.Parallel() key := types.KeyPayee("relayer-address", ibctesting.FirstChannelID) require.Equal(t, string(key), fmt.Sprintf("%s/%s/%s", types.PayeeKeyPrefix, "relayer-address", ibctesting.FirstChannelID)) } func TestParseKeyPayee(t *testing.T) { + t.Parallel() testCases := []struct { name string key string @@ -50,6 +52,7 @@ func TestParseKeyPayee(t *testing.T) { } func TestKeyCounterpartyPayee(t *testing.T) { + t.Parallel() var ( relayerAddress = "relayer_address" channelID = "channel-0" @@ -60,11 +63,13 @@ func TestKeyCounterpartyPayee(t *testing.T) { } func TestKeyFeesInEscrow(t *testing.T) { + t.Parallel() key := types.KeyFeesInEscrow(validPacketID) require.Equal(t, string(key), fmt.Sprintf("%s/%s/%s/%d", types.FeesInEscrowPrefix, ibctesting.MockFeePort, ibctesting.FirstChannelID, 1)) } func TestParseKeyFeeEnabled(t *testing.T) { + t.Parallel() testCases := []struct { name string key string @@ -103,6 +108,7 @@ func TestParseKeyFeeEnabled(t *testing.T) { } func TestParseKeyFeesInEscrow(t *testing.T) { + t.Parallel() testCases := []struct { name string key string @@ -138,6 +144,7 @@ func TestParseKeyFeesInEscrow(t *testing.T) { } func TestParseKeyForwardRelayerAddress(t *testing.T) { + t.Parallel() testCases := []struct { name string key string @@ -173,6 +180,7 @@ func TestParseKeyForwardRelayerAddress(t *testing.T) { } func TestParseKeyCounterpartyPayee(t *testing.T) { + t.Parallel() relayerAddress := "relayer_address" testCases := []struct { diff --git a/modules/apps/29-fee/types/msgs_test.go b/modules/apps/29-fee/types/msgs_test.go index e20984e228b..8d140df41a8 100644 --- a/modules/apps/29-fee/types/msgs_test.go +++ b/modules/apps/29-fee/types/msgs_test.go @@ -13,6 +13,7 @@ import ( ) func TestMsgRegisterPayeeValidation(t *testing.T) { + t.Parallel() var msg *types.MsgRegisterPayee testCases := []struct { @@ -82,12 +83,14 @@ func TestMsgRegisterPayeeValidation(t *testing.T) { } func TestRegisterPayeeGetSigners(t *testing.T) { + t.Parallel() accAddress := sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()) msg := types.NewMsgRegisterPayee(ibctesting.MockPort, ibctesting.FirstChannelID, accAddress.String(), defaultAccAddress) require.Equal(t, []sdk.AccAddress{accAddress}, msg.GetSigners()) } func TestMsgRegisterCountepartyPayeeValidation(t *testing.T) { + t.Parallel() var msg *types.MsgRegisterCounterpartyPayee testCases := []struct { @@ -153,12 +156,14 @@ func TestMsgRegisterCountepartyPayeeValidation(t *testing.T) { } func TestRegisterCountepartyAddressGetSigners(t *testing.T) { + t.Parallel() accAddress := sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()) msg := types.NewMsgRegisterCounterpartyPayee(ibctesting.MockPort, ibctesting.FirstChannelID, accAddress.String(), defaultAccAddress) require.Equal(t, []sdk.AccAddress{accAddress}, msg.GetSigners()) } func TestMsgPayPacketFeeValidation(t *testing.T) { + t.Parallel() var msg *types.MsgPayPacketFee testCases := []struct { @@ -225,6 +230,7 @@ func TestMsgPayPacketFeeValidation(t *testing.T) { } func TestPayPacketFeeGetSigners(t *testing.T) { + t.Parallel() refundAddr := sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()) fee := types.NewFee(defaultRecvFee, defaultAckFee, defaultTimeoutFee) msg := types.NewMsgPayPacketFee(fee, ibctesting.MockFeePort, ibctesting.FirstChannelID, refundAddr.String(), nil) @@ -233,11 +239,13 @@ func TestPayPacketFeeGetSigners(t *testing.T) { } func TestMsgPayPacketFeeRoute(t *testing.T) { + t.Parallel() var msg types.MsgPayPacketFee require.Equal(t, types.RouterKey, msg.Route()) } func TestMsgPayPacketFeeGetSignBytes(t *testing.T) { + t.Parallel() fee := types.NewFee(defaultRecvFee, defaultAckFee, defaultTimeoutFee) msg := types.NewMsgPayPacketFee(fee, ibctesting.MockFeePort, ibctesting.FirstChannelID, defaultAccAddress, nil) @@ -247,6 +255,7 @@ func TestMsgPayPacketFeeGetSignBytes(t *testing.T) { } func TestMsgPayPacketFeeAsyncValidation(t *testing.T) { + t.Parallel() var msg *types.MsgPayPacketFeeAsync testCases := []struct { @@ -371,6 +380,7 @@ func TestMsgPayPacketFeeAsyncValidation(t *testing.T) { } func TestPayPacketFeeAsyncGetSigners(t *testing.T) { + t.Parallel() refundAddr := sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()) packetID := channeltypes.NewPacketID(ibctesting.MockFeePort, ibctesting.FirstChannelID, 1) fee := types.NewFee(defaultRecvFee, defaultAckFee, defaultTimeoutFee) @@ -382,11 +392,13 @@ func TestPayPacketFeeAsyncGetSigners(t *testing.T) { } func TestMsgPayPacketFeeAsyncRoute(t *testing.T) { + t.Parallel() var msg types.MsgPayPacketFeeAsync require.Equal(t, types.RouterKey, msg.Route()) } func TestMsgPayPacketFeeAsyncGetSignBytes(t *testing.T) { + t.Parallel() packetID := channeltypes.NewPacketID(ibctesting.MockFeePort, ibctesting.FirstChannelID, 1) fee := types.NewFee(defaultRecvFee, defaultAckFee, defaultTimeoutFee) packetFee := types.NewPacketFee(fee, defaultAccAddress, nil) diff --git a/modules/apps/transfer/keeper/keeper_test.go b/modules/apps/transfer/keeper/keeper_test.go index 5f58b459f51..9a899430a18 100644 --- a/modules/apps/transfer/keeper/keeper_test.go +++ b/modules/apps/transfer/keeper/keeper_test.go @@ -47,6 +47,7 @@ func NewTransferPath(chainA, chainB *ibctesting.TestChain) *ibctesting.Path { } func TestKeeperTestSuite(t *testing.T) { + t.Parallel() suite.Run(t, new(KeeperTestSuite)) } diff --git a/modules/apps/transfer/simulation/decoder_test.go b/modules/apps/transfer/simulation/decoder_test.go index 654aba6688a..d5ccc7cc04b 100644 --- a/modules/apps/transfer/simulation/decoder_test.go +++ b/modules/apps/transfer/simulation/decoder_test.go @@ -13,6 +13,7 @@ import ( ) func TestDecodeStore(t *testing.T) { + t.Parallel() app := simapp.Setup(t, false) dec := simulation.NewDecodeStore(app.TransferKeeper) @@ -49,6 +50,7 @@ func TestDecodeStore(t *testing.T) { for i, tt := range tests { i, tt := i, tt t.Run(tt.name, func(t *testing.T) { + t.Parallel() if i == len(tests)-1 { require.Panics(t, func() { dec(kvPairs.Pairs[i], kvPairs.Pairs[i]) }, tt.name) } else { diff --git a/modules/apps/transfer/simulation/genesis_test.go b/modules/apps/transfer/simulation/genesis_test.go index 6b56251e97f..360aa339850 100644 --- a/modules/apps/transfer/simulation/genesis_test.go +++ b/modules/apps/transfer/simulation/genesis_test.go @@ -20,6 +20,7 @@ import ( // TestRandomizedGenState tests the normal scenario of applying RandomizedGenState. // Abonormal scenarios are not tested here. func TestRandomizedGenState(t *testing.T) { + t.Parallel() interfaceRegistry := codectypes.NewInterfaceRegistry() cryptocodec.RegisterInterfaces(interfaceRegistry) cdc := codec.NewProtoCodec(interfaceRegistry) @@ -50,6 +51,7 @@ func TestRandomizedGenState(t *testing.T) { // TestRandomizedGenState tests abnormal scenarios of applying RandomizedGenState. func TestRandomizedGenState1(t *testing.T) { + t.Parallel() interfaceRegistry := codectypes.NewInterfaceRegistry() cdc := codec.NewProtoCodec(interfaceRegistry) diff --git a/modules/apps/transfer/transfer_test.go b/modules/apps/transfer/transfer_test.go index 6f718d591f6..40393c0b485 100644 --- a/modules/apps/transfer/transfer_test.go +++ b/modules/apps/transfer/transfer_test.go @@ -142,5 +142,6 @@ func (suite *TransferTestSuite) TestHandleMsgTransfer() { } func TestTransferTestSuite(t *testing.T) { + t.Parallel() suite.Run(t, new(TransferTestSuite)) } diff --git a/modules/apps/transfer/types/genesis_test.go b/modules/apps/transfer/types/genesis_test.go index 415ba2b9b27..bce4141a2de 100644 --- a/modules/apps/transfer/types/genesis_test.go +++ b/modules/apps/transfer/types/genesis_test.go @@ -9,6 +9,7 @@ import ( ) func TestValidateGenesis(t *testing.T) { + t.Parallel() testCases := []struct { name string genState *types.GenesisState diff --git a/modules/apps/transfer/types/keys_test.go b/modules/apps/transfer/types/keys_test.go index e19765ed57c..48d28e88f7c 100644 --- a/modules/apps/transfer/types/keys_test.go +++ b/modules/apps/transfer/types/keys_test.go @@ -11,6 +11,7 @@ import ( // Test that there is domain separation between the port id and the channel id otherwise an // escrow address may overlap with another channel end func TestGetEscrowAddress(t *testing.T) { + t.Parallel() var ( port1 = "transfer" channel1 = "channel" diff --git a/modules/apps/transfer/types/msgs_test.go b/modules/apps/transfer/types/msgs_test.go index 7dcff1be0c2..ec973431145 100644 --- a/modules/apps/transfer/types/msgs_test.go +++ b/modules/apps/transfer/types/msgs_test.go @@ -45,12 +45,14 @@ var ( // TestMsgTransferRoute tests Route for MsgTransfer func TestMsgTransferRoute(t *testing.T) { + t.Parallel() msg := types.NewMsgTransfer(validPort, validChannel, coin, sender, receiver, timeoutHeight, 0, "") require.Equal(t, types.RouterKey, msg.Route()) } func TestMsgTransferGetSignBytes(t *testing.T) { + t.Parallel() msg := types.NewMsgTransfer(validPort, validChannel, coin, sender, receiver, timeoutHeight, 0, "") expected := fmt.Sprintf(`{"type":"cosmos-sdk/MsgTransfer","value":{"receiver":"%s","sender":"%s","source_channel":"testchannel","source_port":"testportid","timeout_height":{"revision_height":"10"},"token":{"amount":"100","denom":"atom"}}}`, receiver, sender) require.NotPanics(t, func() { @@ -61,6 +63,7 @@ func TestMsgTransferGetSignBytes(t *testing.T) { // TestMsgTransferValidation tests ValidateBasic for MsgTransfer func TestMsgTransferValidation(t *testing.T) { + t.Parallel() testCases := []struct { name string msg *types.MsgTransfer @@ -94,6 +97,7 @@ func TestMsgTransferValidation(t *testing.T) { // TestMsgTransferGetSigners tests GetSigners for MsgTransfer func TestMsgTransferGetSigners(t *testing.T) { + t.Parallel() addr := sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()) msg := types.NewMsgTransfer(validPort, validChannel, coin, addr.String(), receiver, timeoutHeight, 0, "") @@ -104,6 +108,7 @@ func TestMsgTransferGetSigners(t *testing.T) { // TestMsgUpdateParamsValidation tests ValidateBasic for MsgUpdateParams func TestMsgUpdateParamsValidation(t *testing.T) { + t.Parallel() testCases := []struct { name string msg *types.MsgUpdateParams @@ -126,6 +131,7 @@ func TestMsgUpdateParamsValidation(t *testing.T) { // TestMsgUpdateParamsGetSigners tests GetSigners for MsgUpdateParams func TestMsgUpdateParamsGetSigners(t *testing.T) { + t.Parallel() authority := sdk.AccAddress("authority") msg := types.MsgUpdateParams{ Authority: authority.String(), diff --git a/modules/apps/transfer/types/packet_test.go b/modules/apps/transfer/types/packet_test.go index 6c877d4fcb0..4d787a34c6d 100644 --- a/modules/apps/transfer/types/packet_test.go +++ b/modules/apps/transfer/types/packet_test.go @@ -17,6 +17,7 @@ const ( // TestFungibleTokenPacketDataValidateBasic tests ValidateBasic for FungibleTokenPacketData func TestFungibleTokenPacketDataValidateBasic(t *testing.T) { + t.Parallel() testCases := []struct { name string packetData types.FungibleTokenPacketData diff --git a/modules/apps/transfer/types/trace_test.go b/modules/apps/transfer/types/trace_test.go index 21e9892a2c3..f6cb6e620b6 100644 --- a/modules/apps/transfer/types/trace_test.go +++ b/modules/apps/transfer/types/trace_test.go @@ -9,6 +9,7 @@ import ( ) func TestParseDenomTrace(t *testing.T) { + t.Parallel() testCases := []struct { name string denom string @@ -45,6 +46,7 @@ func TestParseDenomTrace(t *testing.T) { } func TestDenomTrace_IBCDenom(t *testing.T) { + t.Parallel() testCases := []struct { name string trace types.DenomTrace @@ -61,6 +63,7 @@ func TestDenomTrace_IBCDenom(t *testing.T) { } func TestDenomTrace_Validate(t *testing.T) { + t.Parallel() testCases := []struct { name string trace types.DenomTrace @@ -89,6 +92,7 @@ func TestDenomTrace_Validate(t *testing.T) { } func TestTraces_Validate(t *testing.T) { + t.Parallel() testCases := []struct { name string traces types.Traces @@ -118,6 +122,7 @@ func TestTraces_Validate(t *testing.T) { } func TestValidatePrefixedDenom(t *testing.T) { + t.Parallel() testCases := []struct { name string denom string @@ -146,6 +151,7 @@ func TestValidatePrefixedDenom(t *testing.T) { } func TestValidateIBCDenom(t *testing.T) { + t.Parallel() testCases := []struct { name string denom string diff --git a/modules/apps/transfer/types/types_test.go b/modules/apps/transfer/types/types_test.go index 86069b1a887..3389f3fa7e8 100644 --- a/modules/apps/transfer/types/types_test.go +++ b/modules/apps/transfer/types/types_test.go @@ -36,5 +36,6 @@ func NewTransferPath(chainA, chainB *ibctesting.TestChain) *ibctesting.Path { } func TestTypesTestSuite(t *testing.T) { + t.Parallel() suite.Run(t, new(TypesTestSuite)) } diff --git a/modules/core/02-client/abci_test.go b/modules/core/02-client/abci_test.go index ed760a01f4f..fab08e655e5 100644 --- a/modules/core/02-client/abci_test.go +++ b/modules/core/02-client/abci_test.go @@ -32,6 +32,7 @@ func (suite *ClientTestSuite) SetupTest() { } func TestClientTestSuite(t *testing.T) { + t.Parallel() suite.Run(t, new(ClientTestSuite)) } diff --git a/modules/core/02-client/keeper/keeper_test.go b/modules/core/02-client/keeper/keeper_test.go index 5bc8d1e3cc6..bdc46a5f902 100644 --- a/modules/core/02-client/keeper/keeper_test.go +++ b/modules/core/02-client/keeper/keeper_test.go @@ -120,6 +120,7 @@ func (suite *KeeperTestSuite) SetupTest() { } func TestKeeperTestSuite(t *testing.T) { + t.Parallel() suite.Run(t, new(KeeperTestSuite)) } diff --git a/modules/core/02-client/migrations/v7/store_test.go b/modules/core/02-client/migrations/v7/store_test.go index cb8be6e0f6d..59601b7a661 100644 --- a/modules/core/02-client/migrations/v7/store_test.go +++ b/modules/core/02-client/migrations/v7/store_test.go @@ -35,6 +35,7 @@ func (suite *MigrationsV7TestSuite) SetupTest() { } func TestIBCTestSuite(t *testing.T) { + t.Parallel() suite.Run(t, new(MigrationsV7TestSuite)) } diff --git a/modules/core/02-client/simulation/decoder_test.go b/modules/core/02-client/simulation/decoder_test.go index 19e6b6f9de1..7856c0e68a0 100644 --- a/modules/core/02-client/simulation/decoder_test.go +++ b/modules/core/02-client/simulation/decoder_test.go @@ -16,6 +16,7 @@ import ( ) func TestDecodeStore(t *testing.T) { + t.Parallel() app := simapp.Setup(t, false) clientID := "clientidone" @@ -57,6 +58,7 @@ func TestDecodeStore(t *testing.T) { for i, tt := range tests { i, tt := i, tt t.Run(tt.name, func(t *testing.T) { + t.Parallel() res, found := simulation.NewDecodeStore(app.IBCKeeper.ClientKeeper, kvPairs.Pairs[i], kvPairs.Pairs[i]) if i == len(tests)-1 { require.False(t, found, string(kvPairs.Pairs[i].Key)) diff --git a/modules/core/02-client/types/client_test.go b/modules/core/02-client/types/client_test.go index ecdfd1a31e3..993dcb0184f 100644 --- a/modules/core/02-client/types/client_test.go +++ b/modules/core/02-client/types/client_test.go @@ -58,6 +58,7 @@ func (suite *TypesTestSuite) TestMarshalConsensusStateWithHeight() { } func TestValidateClientType(t *testing.T) { + t.Parallel() testCases := []struct { name string clientType string diff --git a/modules/core/02-client/types/height_test.go b/modules/core/02-client/types/height_test.go index fa4ae59700a..5515502f26c 100644 --- a/modules/core/02-client/types/height_test.go +++ b/modules/core/02-client/types/height_test.go @@ -10,10 +10,12 @@ import ( ) func TestZeroHeight(t *testing.T) { + t.Parallel() require.Equal(t, types.Height{}, types.ZeroHeight()) } func TestCompareHeights(t *testing.T) { + t.Parallel() testCases := []struct { name string height1 types.Height @@ -47,6 +49,7 @@ func TestCompareHeights(t *testing.T) { } func TestDecrement(t *testing.T) { + t.Parallel() validDecrement := types.NewHeight(3, 3) expected := types.NewHeight(3, 2) @@ -63,6 +66,7 @@ func TestDecrement(t *testing.T) { } func TestString(t *testing.T) { + t.Parallel() _, err := types.ParseHeight("height") require.Error(t, err, "invalid height string passed") @@ -98,6 +102,7 @@ func (suite *TypesTestSuite) TestMustParseHeight() { } func TestParseChainID(t *testing.T) { + t.Parallel() cases := []struct { chainID string revision uint64 @@ -129,6 +134,7 @@ func TestParseChainID(t *testing.T) { } func TestSetRevisionNumber(t *testing.T) { + t.Parallel() // Test SetRevisionNumber chainID, err := types.SetRevisionNumber("gaiamainnet", 3) require.Error(t, err, "invalid revision format passed SetRevisionNumber") diff --git a/modules/core/02-client/types/keys_test.go b/modules/core/02-client/types/keys_test.go index 93c295df627..46ec93ea98c 100644 --- a/modules/core/02-client/types/keys_test.go +++ b/modules/core/02-client/types/keys_test.go @@ -11,6 +11,7 @@ import ( // tests ParseClientIdentifier and IsValidClientID func TestParseClientIdentifier(t *testing.T) { + t.Parallel() testCases := []struct { name string clientID string @@ -47,6 +48,7 @@ func TestParseClientIdentifier(t *testing.T) { for _, tc := range testCases { tc := tc t.Run(tc.name, func(t *testing.T) { + t.Parallel() clientType, seq, err := types.ParseClientIdentifier(tc.clientID) valid := types.IsValidClientID(tc.clientID) require.Equal(t, tc.expSeq, seq, tc.clientID) diff --git a/modules/core/02-client/types/msgs_test.go b/modules/core/02-client/types/msgs_test.go index cffa77e4611..b004bc7c1d5 100644 --- a/modules/core/02-client/types/msgs_test.go +++ b/modules/core/02-client/types/msgs_test.go @@ -32,6 +32,7 @@ func (suite *TypesTestSuite) SetupTest() { } func TestTypesTestSuite(t *testing.T) { + t.Parallel() suite.Run(t, new(TypesTestSuite)) } diff --git a/modules/core/02-client/types/params_test.go b/modules/core/02-client/types/params_test.go index d88400eee40..efb39da33ca 100644 --- a/modules/core/02-client/types/params_test.go +++ b/modules/core/02-client/types/params_test.go @@ -9,6 +9,7 @@ import ( ) func TestIsAllowedClient(t *testing.T) { + t.Parallel() testCases := []struct { name string clientType string @@ -27,6 +28,7 @@ func TestIsAllowedClient(t *testing.T) { } func TestValidateParams(t *testing.T) { + t.Parallel() testCases := []struct { name string params Params diff --git a/modules/core/03-connection/keeper/keeper_test.go b/modules/core/03-connection/keeper/keeper_test.go index 5f4e5b3f244..4ffef0bd224 100644 --- a/modules/core/03-connection/keeper/keeper_test.go +++ b/modules/core/03-connection/keeper/keeper_test.go @@ -29,6 +29,7 @@ func (suite *KeeperTestSuite) SetupTest() { } func TestKeeperTestSuite(t *testing.T) { + t.Parallel() suite.Run(t, new(KeeperTestSuite)) } diff --git a/modules/core/03-connection/simulation/decoder_test.go b/modules/core/03-connection/simulation/decoder_test.go index 698bfda539d..981f72a880b 100644 --- a/modules/core/03-connection/simulation/decoder_test.go +++ b/modules/core/03-connection/simulation/decoder_test.go @@ -14,6 +14,7 @@ import ( ) func TestDecodeStore(t *testing.T) { + t.Parallel() app := simapp.Setup(t, false) cdc := app.AppCodec() @@ -56,6 +57,7 @@ func TestDecodeStore(t *testing.T) { for i, tt := range tests { i, tt := i, tt t.Run(tt.name, func(t *testing.T) { + t.Parallel() res, found := simulation.NewDecodeStore(cdc, kvPairs.Pairs[i], kvPairs.Pairs[i]) if i == len(tests)-1 { require.False(t, found, string(kvPairs.Pairs[i].Key)) diff --git a/modules/core/03-connection/types/connection_test.go b/modules/core/03-connection/types/connection_test.go index 56daca299b8..d59591d603b 100644 --- a/modules/core/03-connection/types/connection_test.go +++ b/modules/core/03-connection/types/connection_test.go @@ -22,6 +22,7 @@ var ( ) func TestConnectionValidateBasic(t *testing.T) { + t.Parallel() testCases := []struct { name string connection types.ConnectionEnd @@ -67,6 +68,7 @@ func TestConnectionValidateBasic(t *testing.T) { } func TestCounterpartyValidateBasic(t *testing.T) { + t.Parallel() testCases := []struct { name string counterparty types.Counterparty @@ -91,6 +93,7 @@ func TestCounterpartyValidateBasic(t *testing.T) { } func TestIdentifiedConnectionValidateBasic(t *testing.T) { + t.Parallel() testCases := []struct { name string connection types.IdentifiedConnection diff --git a/modules/core/03-connection/types/genesis_test.go b/modules/core/03-connection/types/genesis_test.go index 0b513cfdace..cc70cc6f98c 100644 --- a/modules/core/03-connection/types/genesis_test.go +++ b/modules/core/03-connection/types/genesis_test.go @@ -11,6 +11,7 @@ import ( ) func TestValidateGenesis(t *testing.T) { + t.Parallel() testCases := []struct { name string genState types.GenesisState diff --git a/modules/core/03-connection/types/keys_test.go b/modules/core/03-connection/types/keys_test.go index 2185ebc462c..586cd259310 100644 --- a/modules/core/03-connection/types/keys_test.go +++ b/modules/core/03-connection/types/keys_test.go @@ -11,6 +11,7 @@ import ( // tests ParseConnectionSequence and IsValidConnectionID func TestParseConnectionSequence(t *testing.T) { + t.Parallel() testCases := []struct { name string connectionID string diff --git a/modules/core/03-connection/types/msgs_test.go b/modules/core/03-connection/types/msgs_test.go index 0880155c8c5..1b29853b36a 100644 --- a/modules/core/03-connection/types/msgs_test.go +++ b/modules/core/03-connection/types/msgs_test.go @@ -75,6 +75,7 @@ func (suite *MsgTestSuite) SetupTest() { } func TestMsgTestSuite(t *testing.T) { + t.Parallel() suite.Run(t, new(MsgTestSuite)) } diff --git a/modules/core/03-connection/types/params_test.go b/modules/core/03-connection/types/params_test.go index 8afc407d723..8e66c20199f 100644 --- a/modules/core/03-connection/types/params_test.go +++ b/modules/core/03-connection/types/params_test.go @@ -9,6 +9,7 @@ import ( ) func TestValidateParams(t *testing.T) { + t.Parallel() testCases := []struct { name string params types.Params diff --git a/modules/core/03-connection/types/version_test.go b/modules/core/03-connection/types/version_test.go index 9aa4abf9259..c97a8837898 100644 --- a/modules/core/03-connection/types/version_test.go +++ b/modules/core/03-connection/types/version_test.go @@ -11,6 +11,7 @@ import ( ) func TestValidateVersion(t *testing.T) { + t.Parallel() testCases := []struct { name string version *types.Version @@ -34,6 +35,7 @@ func TestValidateVersion(t *testing.T) { } func TestIsSupportedVersion(t *testing.T) { + t.Parallel() testCases := []struct { name string version *types.Version @@ -62,6 +64,7 @@ func TestIsSupportedVersion(t *testing.T) { } func TestFindSupportedVersion(t *testing.T) { + t.Parallel() testCases := []struct { name string version *types.Version @@ -90,6 +93,7 @@ func TestFindSupportedVersion(t *testing.T) { } func TestPickVersion(t *testing.T) { + t.Parallel() testCases := []struct { name string supportedVersions []exported.Version @@ -119,6 +123,7 @@ func TestPickVersion(t *testing.T) { } func TestVerifyProposedVersion(t *testing.T) { + t.Parallel() testCases := []struct { name string proposedVersion *types.Version @@ -144,6 +149,7 @@ func TestVerifyProposedVersion(t *testing.T) { } func TestVerifySupportedFeature(t *testing.T) { + t.Parallel() nilFeatures := types.NewVersion(types.DefaultIBCVersionIdentifier, nil) testCases := []struct { diff --git a/modules/core/04-channel/keeper/keeper_test.go b/modules/core/04-channel/keeper/keeper_test.go index 92afaba9135..19b093f58b6 100644 --- a/modules/core/04-channel/keeper/keeper_test.go +++ b/modules/core/04-channel/keeper/keeper_test.go @@ -25,6 +25,7 @@ type KeeperTestSuite struct { // TestKeeperTestSuite runs all the tests within this package. func TestKeeperTestSuite(t *testing.T) { + t.Parallel() suite.Run(t, new(KeeperTestSuite)) } diff --git a/modules/core/04-channel/simulation/decoder_test.go b/modules/core/04-channel/simulation/decoder_test.go index 67883b4f6e4..556b9d332ed 100644 --- a/modules/core/04-channel/simulation/decoder_test.go +++ b/modules/core/04-channel/simulation/decoder_test.go @@ -15,6 +15,7 @@ import ( ) func TestDecodeStore(t *testing.T) { + t.Parallel() app := simapp.Setup(t, false) cdc := app.AppCodec() @@ -76,6 +77,7 @@ func TestDecodeStore(t *testing.T) { for i, tt := range tests { i, tt := i, tt t.Run(tt.name, func(t *testing.T) { + t.Parallel() res, found := simulation.NewDecodeStore(cdc, kvPairs.Pairs[i], kvPairs.Pairs[i]) if i == len(tests)-1 { require.False(t, found, string(kvPairs.Pairs[i].Key)) diff --git a/modules/core/04-channel/types/channel_test.go b/modules/core/04-channel/types/channel_test.go index 0817af7fc81..bfc58b59492 100644 --- a/modules/core/04-channel/types/channel_test.go +++ b/modules/core/04-channel/types/channel_test.go @@ -9,6 +9,7 @@ import ( ) func TestChannelValidateBasic(t *testing.T) { + t.Parallel() counterparty := types.Counterparty{"portidone", "channelidone"} testCases := []struct { name string @@ -36,6 +37,7 @@ func TestChannelValidateBasic(t *testing.T) { } func TestCounterpartyValidateBasic(t *testing.T) { + t.Parallel() testCases := []struct { name string counterparty types.Counterparty diff --git a/modules/core/04-channel/types/genesis_test.go b/modules/core/04-channel/types/genesis_test.go index 10fd5248a59..46e38ec053b 100644 --- a/modules/core/04-channel/types/genesis_test.go +++ b/modules/core/04-channel/types/genesis_test.go @@ -21,6 +21,7 @@ const ( ) func TestValidateGenesis(t *testing.T) { + t.Parallel() counterparty1 := types.NewCounterparty(testPort1, testChannel1) counterparty2 := types.NewCounterparty(testPort2, testChannel2) testCases := []struct { diff --git a/modules/core/04-channel/types/keys_test.go b/modules/core/04-channel/types/keys_test.go index 72bd91b5613..f3b69f518f3 100644 --- a/modules/core/04-channel/types/keys_test.go +++ b/modules/core/04-channel/types/keys_test.go @@ -10,6 +10,7 @@ import ( // tests ParseChannelSequence and IsValidChannelID func TestParseChannelSequence(t *testing.T) { + t.Parallel() testCases := []struct { name string channelID string diff --git a/modules/core/04-channel/types/msgs_test.go b/modules/core/04-channel/types/msgs_test.go index 9e2d28554fb..20b9a0c5c5c 100644 --- a/modules/core/04-channel/types/msgs_test.go +++ b/modules/core/04-channel/types/msgs_test.go @@ -106,6 +106,7 @@ func (suite *TypesTestSuite) SetupTest() { } func TestTypesTestSuite(t *testing.T) { + t.Parallel() suite.Run(t, new(TypesTestSuite)) } diff --git a/modules/core/04-channel/types/packet_test.go b/modules/core/04-channel/types/packet_test.go index 780844dbb54..e0aeb749da7 100644 --- a/modules/core/04-channel/types/packet_test.go +++ b/modules/core/04-channel/types/packet_test.go @@ -12,6 +12,7 @@ import ( ) func TestCommitPacket(t *testing.T) { + t.Parallel() packet := types.NewPacket(validPacketData, 1, portid, chanid, cpportid, cpchanid, timeoutHeight, timeoutTimestamp) registry := codectypes.NewInterfaceRegistry() @@ -25,6 +26,7 @@ func TestCommitPacket(t *testing.T) { } func TestPacketValidateBasic(t *testing.T) { + t.Parallel() testCases := []struct { packet types.Packet expPass bool diff --git a/modules/core/05-port/keeper/keeper_test.go b/modules/core/05-port/keeper/keeper_test.go index 6b2aca8b7e5..4a1a50936fc 100644 --- a/modules/core/05-port/keeper/keeper_test.go +++ b/modules/core/05-port/keeper/keeper_test.go @@ -32,6 +32,7 @@ func (suite *KeeperTestSuite) SetupTest() { } func TestKeeperTestSuite(t *testing.T) { + t.Parallel() suite.Run(t, new(KeeperTestSuite)) } diff --git a/modules/core/23-commitment/types/commitment_test.go b/modules/core/23-commitment/types/commitment_test.go index 9e30f850575..4cf4da27c62 100644 --- a/modules/core/23-commitment/types/commitment_test.go +++ b/modules/core/23-commitment/types/commitment_test.go @@ -34,5 +34,6 @@ func (suite *MerkleTestSuite) SetupTest() { } func TestMerkleTestSuite(t *testing.T) { + t.Parallel() suite.Run(t, new(MerkleTestSuite)) } diff --git a/modules/core/23-commitment/types/merkle_test.go b/modules/core/23-commitment/types/merkle_test.go index da70caae330..3f66e8fdf8b 100644 --- a/modules/core/23-commitment/types/merkle_test.go +++ b/modules/core/23-commitment/types/merkle_test.go @@ -140,6 +140,7 @@ func (suite *MerkleTestSuite) TestVerifyNonMembership() { } func TestApplyPrefix(t *testing.T) { + t.Parallel() prefix := types.NewMerklePrefix([]byte("storePrefixKey")) pathStr := "pathone/pathtwo/paththree/key" @@ -155,6 +156,7 @@ func TestApplyPrefix(t *testing.T) { } func TestString(t *testing.T) { + t.Parallel() path := types.NewMerklePath("rootKey", "storeKey", "path/to/leaf") require.Equal(t, "/rootKey/storeKey/path%2Fto%2Fleaf", path.String(), "path String returns unxpected value") diff --git a/modules/core/24-host/parse_test.go b/modules/core/24-host/parse_test.go index 18c3ab2e832..5025788e01d 100644 --- a/modules/core/24-host/parse_test.go +++ b/modules/core/24-host/parse_test.go @@ -13,6 +13,7 @@ import ( ) func TestParseIdentifier(t *testing.T) { + t.Parallel() testCases := []struct { name string identifier string @@ -50,6 +51,7 @@ func TestParseIdentifier(t *testing.T) { } func TestMustParseClientStatePath(t *testing.T) { + t.Parallel() testCases := []struct { name string path string diff --git a/modules/core/24-host/validate_test.go b/modules/core/24-host/validate_test.go index e75ce9334bd..d8d63d26e5d 100644 --- a/modules/core/24-host/validate_test.go +++ b/modules/core/24-host/validate_test.go @@ -18,6 +18,7 @@ type testCase struct { } func TestDefaultIdentifierValidator(t *testing.T) { + t.Parallel() testCases := []testCase{ {"valid lowercase", "lowercaseid", true}, {"valid id special chars", "._+-#[]<>._+-#[]<>", true}, @@ -54,6 +55,7 @@ func TestDefaultIdentifierValidator(t *testing.T) { } func TestPortIdentifierValidator(t *testing.T) { + t.Parallel() testCases := []testCase{ {"valid lowercase", "transfer", true}, {"valid id special chars", "._+-#[]<>._+-#[]<>", true}, @@ -81,6 +83,7 @@ func TestPortIdentifierValidator(t *testing.T) { } func TestPathValidator(t *testing.T) { + t.Parallel() testCases := []testCase{ {"valid lowercase", "p/lowercaseid", true}, {"numeric path", "p/239123", true}, @@ -120,6 +123,7 @@ func TestPathValidator(t *testing.T) { } func TestCustomPathValidator(t *testing.T) { + t.Parallel() validateFn := NewPathValidator(func(path string) error { if !strings.HasPrefix(path, "id_") { return fmt.Errorf("identifier %s must start with 'id_", path) diff --git a/modules/core/ante/ante_test.go b/modules/core/ante/ante_test.go index 20ed350a053..1313717ff09 100644 --- a/modules/core/ante/ante_test.go +++ b/modules/core/ante/ante_test.go @@ -41,6 +41,7 @@ func (suite *AnteTestSuite) SetupTest() { // TestAnteTestSuite runs all the tests within this package. func TestAnteTestSuite(t *testing.T) { + t.Parallel() suite.Run(t, new(AnteTestSuite)) } diff --git a/modules/core/genesis_test.go b/modules/core/genesis_test.go index 5e2f80a5134..1c113ffbdea 100644 --- a/modules/core/genesis_test.go +++ b/modules/core/genesis_test.go @@ -52,6 +52,7 @@ func (suite *IBCTestSuite) SetupTest() { } func TestIBCTestSuite(t *testing.T) { + t.Parallel() suite.Run(t, new(IBCTestSuite)) } diff --git a/modules/core/keeper/keeper_test.go b/modules/core/keeper/keeper_test.go index 596b935244b..f8020cc4e95 100644 --- a/modules/core/keeper/keeper_test.go +++ b/modules/core/keeper/keeper_test.go @@ -39,6 +39,7 @@ func (suite *KeeperTestSuite) SetupTest() { } func TestKeeperTestSuite(t *testing.T) { + t.Parallel() suite.Run(t, new(KeeperTestSuite)) } diff --git a/modules/core/migrations/v7/genesis_test.go b/modules/core/migrations/v7/genesis_test.go index 943a9d9593f..32060378ab7 100644 --- a/modules/core/migrations/v7/genesis_test.go +++ b/modules/core/migrations/v7/genesis_test.go @@ -30,6 +30,7 @@ type MigrationsV7TestSuite struct { // TestMigrationsV7TestSuite runs all the tests within this package. func TestMigrationsV7TestSuite(t *testing.T) { + t.Parallel() suite.Run(t, new(MigrationsV7TestSuite)) } diff --git a/modules/core/simulation/decoder_test.go b/modules/core/simulation/decoder_test.go index 4bd39e8395d..5fd017114f4 100644 --- a/modules/core/simulation/decoder_test.go +++ b/modules/core/simulation/decoder_test.go @@ -17,6 +17,7 @@ import ( ) func TestDecodeStore(t *testing.T) { + t.Parallel() app := simapp.Setup(t, false) dec := simulation.NewDecodeStore(*app.IBCKeeper) @@ -70,6 +71,7 @@ func TestDecodeStore(t *testing.T) { for i, tt := range tests { i, tt := i, tt t.Run(tt.name, func(t *testing.T) { + t.Parallel() if i == len(tests)-1 { require.Panics(t, func() { dec(kvPairs.Pairs[i], kvPairs.Pairs[i]) }, tt.name) } else { diff --git a/modules/core/simulation/genesis_test.go b/modules/core/simulation/genesis_test.go index f3bbf9ecc1c..bd3b6c63ebc 100644 --- a/modules/core/simulation/genesis_test.go +++ b/modules/core/simulation/genesis_test.go @@ -21,6 +21,7 @@ import ( // TestRandomizedGenState tests the normal scenario of applying RandomizedGenState. // Abonormal scenarios are not tested here. func TestRandomizedGenState(t *testing.T) { + t.Parallel() interfaceRegistry := codectypes.NewInterfaceRegistry() cryptocodec.RegisterInterfaces(interfaceRegistry) cdc := codec.NewProtoCodec(interfaceRegistry) diff --git a/modules/light-clients/06-solomachine/solomachine_test.go b/modules/light-clients/06-solomachine/solomachine_test.go index 1267b3683a4..acfdffaf5a7 100644 --- a/modules/light-clients/06-solomachine/solomachine_test.go +++ b/modules/light-clients/06-solomachine/solomachine_test.go @@ -50,6 +50,7 @@ func (suite *SoloMachineTestSuite) SetupTest() { } func TestSoloMachineTestSuite(t *testing.T) { + t.Parallel() suite.Run(t, new(SoloMachineTestSuite)) } @@ -153,6 +154,7 @@ func (suite *SoloMachineTestSuite) GetInvalidProof() []byte { } func TestUnpackInterfaces_Header(t *testing.T) { + t.Parallel() registry := testdata.NewTestInterfaceRegistry() cryptocodec.RegisterInterfaces(registry) @@ -177,6 +179,7 @@ func TestUnpackInterfaces_Header(t *testing.T) { } func TestUnpackInterfaces_HeaderData(t *testing.T) { + t.Parallel() registry := testdata.NewTestInterfaceRegistry() cryptocodec.RegisterInterfaces(registry) diff --git a/modules/light-clients/07-tendermint/migrations/migrations_test.go b/modules/light-clients/07-tendermint/migrations/migrations_test.go index 7a261caaf8c..43d2ca0dce5 100644 --- a/modules/light-clients/07-tendermint/migrations/migrations_test.go +++ b/modules/light-clients/07-tendermint/migrations/migrations_test.go @@ -31,6 +31,7 @@ func (suite *MigrationsTestSuite) SetupTest() { } func TestTendermintTestSuite(t *testing.T) { + t.Parallel() suite.Run(t, new(MigrationsTestSuite)) } diff --git a/modules/light-clients/07-tendermint/tendermint_test.go b/modules/light-clients/07-tendermint/tendermint_test.go index d6a719c6170..7398df06cc6 100644 --- a/modules/light-clients/07-tendermint/tendermint_test.go +++ b/modules/light-clients/07-tendermint/tendermint_test.go @@ -97,5 +97,6 @@ func getAltSigners(altVal *tmtypes.Validator, altPrivVal tmtypes.PrivValidator) } func TestTendermintTestSuite(t *testing.T) { + t.Parallel() suite.Run(t, new(TendermintTestSuite)) } diff --git a/modules/light-clients/09-localhost/localhost_test.go b/modules/light-clients/09-localhost/localhost_test.go index c22ef1e35ae..919c1a53497 100644 --- a/modules/light-clients/09-localhost/localhost_test.go +++ b/modules/light-clients/09-localhost/localhost_test.go @@ -21,5 +21,6 @@ func (suite *LocalhostTestSuite) SetupTest() { } func TestLocalhostTestSuite(t *testing.T) { + t.Parallel() suite.Run(t, new(LocalhostTestSuite)) } diff --git a/testing/chain_test.go b/testing/chain_test.go index 0f934bacd8a..31cf6d5b120 100644 --- a/testing/chain_test.go +++ b/testing/chain_test.go @@ -11,6 +11,7 @@ import ( ) func TestChangeValSet(t *testing.T) { + t.Parallel() coord := ibctesting.NewCoordinator(t, 2) chainA := coord.GetChain(ibctesting.GetChainID(1)) chainB := coord.GetChain(ibctesting.GetChainID(2)) diff --git a/testing/mock/ibc_module_test.go b/testing/mock/ibc_module_test.go index 6eec0c11db9..b9cd709d640 100644 --- a/testing/mock/ibc_module_test.go +++ b/testing/mock/ibc_module_test.go @@ -11,6 +11,7 @@ import ( ) func TestCreateCapabilityName(t *testing.T) { + t.Parallel() packet := channeltypes.NewPacket( []byte{}, 1, diff --git a/testing/mock/privval_test.go b/testing/mock/privval_test.go index d8ef0e4409b..54a955625ab 100644 --- a/testing/mock/privval_test.go +++ b/testing/mock/privval_test.go @@ -13,6 +13,7 @@ import ( const chainID = "testChain" func TestGetPubKey(t *testing.T) { + t.Parallel() pv := mock.NewPV() pk, err := pv.GetPubKey() require.NoError(t, err) @@ -20,6 +21,7 @@ func TestGetPubKey(t *testing.T) { } func TestSignVote(t *testing.T) { + t.Parallel() pv := mock.NewPV() pk, _ := pv.GetPubKey() @@ -33,6 +35,7 @@ func TestSignVote(t *testing.T) { } func TestSignProposal(t *testing.T) { + t.Parallel() pv := mock.NewPV() pk, _ := pv.GetPubKey() diff --git a/testing/simapp/genesis_account_test.go b/testing/simapp/genesis_account_test.go index c2a7ea0431d..bedd85500c5 100644 --- a/testing/simapp/genesis_account_test.go +++ b/testing/simapp/genesis_account_test.go @@ -14,6 +14,7 @@ import ( ) func TestSimGenesisAccountValidate(t *testing.T) { + t.Parallel() pubkey := secp256k1.GenPrivKey().PubKey() addr := sdk.AccAddress(pubkey.Address()) @@ -82,6 +83,7 @@ func TestSimGenesisAccountValidate(t *testing.T) { for _, tc := range testCases { tc := tc t.Run(tc.name, func(t *testing.T) { + t.Parallel() require.Equal(t, tc.wantErr, tc.sga.Validate() != nil) }) } diff --git a/testing/simapp/sim_test.go b/testing/simapp/sim_test.go index 61452bd3269..a220c374710 100644 --- a/testing/simapp/sim_test.go +++ b/testing/simapp/sim_test.go @@ -57,6 +57,7 @@ func interBlockCacheOpt() func(*baseapp.BaseApp) { } func TestFullAppSimulation(t *testing.T) { + t.Parallel() config := simcli.NewConfigFromFlags() config.ChainID = SimAppChainID @@ -102,6 +103,7 @@ func TestFullAppSimulation(t *testing.T) { } func TestAppImportExport(t *testing.T) { + t.Parallel() config := simcli.NewConfigFromFlags() config.ChainID = SimAppChainID @@ -225,6 +227,7 @@ func TestAppImportExport(t *testing.T) { } func TestAppSimulationAfterImport(t *testing.T) { + t.Parallel() config := simcli.NewConfigFromFlags() config.ChainID = SimAppChainID @@ -314,6 +317,7 @@ func TestAppSimulationAfterImport(t *testing.T) { // TODO: Make another test for the fuzzer itself, which just has noOp txs // and doesn't depend on the application. func TestAppStateDeterminism(t *testing.T) { + t.Parallel() if !simcli.FlagEnabledValue { t.Skip("skipping application simulation") } diff --git a/testing/simapp/simd/cmd/cmd_test.go b/testing/simapp/simd/cmd/cmd_test.go index 63dc5e5b4e4..1cc3ce449d4 100644 --- a/testing/simapp/simd/cmd/cmd_test.go +++ b/testing/simapp/simd/cmd/cmd_test.go @@ -15,6 +15,7 @@ import ( func TestInitCmd(t *testing.T) { rootCmd := cmd.NewRootCmd() + t.Parallel() rootCmd.SetArgs([]string{ "init", // Test the init cmd "simapp-test", // Moniker @@ -25,6 +26,7 @@ func TestInitCmd(t *testing.T) { } func TestHomeFlagRegistration(t *testing.T) { + t.Parallel() homeDir := "/tmp/foo" rootCmd := cmd.NewRootCmd() diff --git a/testing/simapp/testutil_network_test.go b/testing/simapp/testutil_network_test.go index 570ddb8eb23..0d8eed9cdad 100644 --- a/testing/simapp/testutil_network_test.go +++ b/testing/simapp/testutil_network_test.go @@ -38,5 +38,6 @@ func (s *IntegrationTestSuite) TestNetwork_Liveness() { } func TestIntegrationTestSuite(t *testing.T) { + t.Parallel() suite.Run(t, new(IntegrationTestSuite)) }