From 8e6e6f185e958c86d807771c940109128786dbc9 Mon Sep 17 00:00:00 2001 From: Iulian Pascalau Date: Thu, 14 Mar 2024 16:03:28 +0200 Subject: [PATCH 1/2] - uniformized the calling methods for integration tests --- genesis/process/genesisBlockCreator_test.go | 10 +- .../vm/delegation/changeOwner_test.go | 6 +- .../vm/delegation/delegationMulti_test.go | 10 +- .../vm/delegation/delegationScenarios_test.go | 58 ++++++- .../vm/delegation/delegation_test.go | 2 - .../esdtLocalFunsSC_MockContracts_test.go | 2 - .../esdt/localFuncs/esdtLocalFunsSC_test.go | 25 +-- .../vm/esdt/multisign/esdtMultisign_test.go | 2 - .../vm/esdt/nft/esdtNFT/esdtNft_test.go | 6 +- .../vm/esdt/nft/esdtNFTSCs/esdtNFTSCs_test.go | 2 - .../vm/esdt/process/esdtProcess_test.go | 133 +--------------- .../vm/esdt/roles/esdtRoles_test.go | 2 - .../vm/txsFee/asyncCall_multi_test.go | 30 +++- integrationTests/vm/txsFee/asyncCall_test.go | 21 +-- integrationTests/vm/txsFee/asyncESDT_test.go | 36 ++++- .../vm/txsFee/builtInFunctions_test.go | 8 +- integrationTests/vm/txsFee/dns_test.go | 17 +- .../vm/txsFee/dynamicGasCost_test.go | 8 +- .../vm/txsFee/guardAccount_test.go | 28 +++- .../vm/txsFee/migrateDataTrie_test.go | 8 +- .../vm/txsFee/multiShard/asyncCall_test.go | 7 +- .../vm/txsFee/multiShard/asyncESDT_test.go | 12 +- .../txsFee/multiShard/relayedScDeploy_test.go | 6 +- .../multiShard/relayedTxScCalls_test.go | 12 +- .../scCallWithValueTransfer_test.go | 10 +- .../vm/txsFee/multiShard/scCalls_test.go | 12 +- .../vm/txsFee/relayedAsyncCall_test.go | 8 +- .../vm/txsFee/relayedAsyncESDT_test.go | 16 +- .../vm/txsFee/relayedBuiltInFunctions_test.go | 24 ++- integrationTests/vm/txsFee/relayedDns_test.go | 8 +- .../vm/txsFee/relayedESDT_test.go | 12 +- .../vm/txsFee/relayedScCalls_test.go | 28 +++- .../vm/txsFee/relayedScDeploy_test.go | 20 ++- integrationTests/vm/txsFee/scCalls_test.go | 44 +++++- integrationTests/vm/txsFee/scDeploy_test.go | 20 ++- .../vm/wasm/badcontracts/badcontracts_test.go | 5 +- .../delegation/delegationSimulation_test.go | 2 - .../vm/wasm/delegation/delegation_test.go | 5 +- integrationTests/vm/wasm/erc20/erc20_test.go | 5 +- .../vm/wasm/queries/queries_test.go | 4 - .../vm/wasm/transfers/transfers_test.go | 6 +- .../vm/wasm/upgrades/upgrades_test.go | 28 +++- .../vm/wasm/wasmer/wasmer_test.go | 20 ++- .../wasmvm/executeViaBlockchainhook_test.go | 5 +- .../vm/wasm/wasmvm/gasSchedule_test.go | 147 +++++++++++++++++- .../vm/wasm/wasmvm/versionswitch/vm_test.go | 4 - .../wasmvm/versionswitch_revert/vm_test.go | 4 - .../wasmvm/versionswitch_vmquery/vm_test.go | 4 - .../vm/wasm/wasmvm/wasmVM_test.go | 51 +++++- node/nodeRunner_test.go | 18 ++- 50 files changed, 644 insertions(+), 317 deletions(-) diff --git a/genesis/process/genesisBlockCreator_test.go b/genesis/process/genesisBlockCreator_test.go index 7553025f369..2ccea85ef14 100644 --- a/genesis/process/genesisBlockCreator_test.go +++ b/genesis/process/genesisBlockCreator_test.go @@ -180,7 +180,7 @@ func createMockArgument( SCDeployEnableEpoch: unreachableEpoch, CleanUpInformativeSCRsEnableEpoch: unreachableEpoch, SCProcessorV2EnableEpoch: unreachableEpoch, - StakeLimitsEnableEpoch: 10, + StakeLimitsEnableEpoch: 10, }, }, RoundConfig: testscommon.GetDefaultRoundsConfig(), @@ -897,9 +897,9 @@ func TestCreateArgsGenesisBlockCreator_ShouldWorkAndCreateEmpty(t *testing.T) { blocks, err := gbc.CreateGenesisBlocks() assert.Nil(t, err) assert.Equal(t, 3, len(blocks)) - for _, block := range blocks { - assert.Zero(t, block.GetNonce()) - assert.Zero(t, block.GetRound()) - assert.Zero(t, block.GetEpoch()) + for _, blockInstance := range blocks { + assert.Zero(t, blockInstance.GetNonce()) + assert.Zero(t, blockInstance.GetRound()) + assert.Zero(t, blockInstance.GetEpoch()) } } diff --git a/integrationTests/vm/delegation/changeOwner_test.go b/integrationTests/vm/delegation/changeOwner_test.go index 2b23993882d..c634452ea9c 100644 --- a/integrationTests/vm/delegation/changeOwner_test.go +++ b/integrationTests/vm/delegation/changeOwner_test.go @@ -1,5 +1,3 @@ -//go:build !race - package delegation import ( @@ -23,6 +21,10 @@ var ( ) func TestDelegationChangeOwnerOnAccountHandler(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + t.Run("fix flag not activated, should not save - backwards compatibility", func(t *testing.T) { _, _, userAccount := testDelegationChangeOwnerOnAccountHandler(t, 1) diff --git a/integrationTests/vm/delegation/delegationMulti_test.go b/integrationTests/vm/delegation/delegationMulti_test.go index 90d307c741d..b0eef67dcaa 100644 --- a/integrationTests/vm/delegation/delegationMulti_test.go +++ b/integrationTests/vm/delegation/delegationMulti_test.go @@ -1,5 +1,3 @@ -//go:build !race - package delegation import ( @@ -19,6 +17,10 @@ import ( ) func TestDelegationSystemClaimMulti(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + tpn := integrationTests.NewTestProcessorNode(integrationTests.ArgTestProcessorNode{ MaxShards: 1, NodeShardId: core.MetachainShardId, @@ -127,6 +129,10 @@ func TestDelegationSystemClaimMulti(t *testing.T) { } func TestDelegationSystemRedelegateMulti(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + tpn := integrationTests.NewTestProcessorNode(integrationTests.ArgTestProcessorNode{ MaxShards: 1, NodeShardId: core.MetachainShardId, diff --git a/integrationTests/vm/delegation/delegationScenarios_test.go b/integrationTests/vm/delegation/delegationScenarios_test.go index e1d58b12d6d..4b9dbd07fba 100644 --- a/integrationTests/vm/delegation/delegationScenarios_test.go +++ b/integrationTests/vm/delegation/delegationScenarios_test.go @@ -1,5 +1,3 @@ -//go:build !race - package delegation import ( @@ -32,6 +30,10 @@ import ( ) func TestDelegationSystemNodesOperationsTestBackwardComp(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + tpn := integrationTests.NewTestProcessorNode(integrationTests.ArgTestProcessorNode{ MaxShards: 1, NodeShardId: core.MetachainShardId, @@ -82,6 +84,10 @@ func TestDelegationSystemNodesOperationsTestBackwardComp(t *testing.T) { } func TestDelegationSystemNodesOperations(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + tpn := integrationTests.NewTestProcessorNode(integrationTests.ArgTestProcessorNode{ MaxShards: 1, NodeShardId: core.MetachainShardId, @@ -163,6 +169,10 @@ func TestDelegationSystemNodesOperations(t *testing.T) { } func TestDelegationSystemReStakeNodes(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + tpn := integrationTests.NewTestProcessorNode(integrationTests.ArgTestProcessorNode{ MaxShards: 1, NodeShardId: core.MetachainShardId, @@ -230,6 +240,10 @@ func TestDelegationSystemReStakeNodes(t *testing.T) { } func TestDelegationChangeConfig(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + tpn := integrationTests.NewTestProcessorNode(integrationTests.ArgTestProcessorNode{ MaxShards: 1, NodeShardId: core.MetachainShardId, @@ -288,6 +302,10 @@ func TestDelegationChangeConfig(t *testing.T) { } func TestDelegationSystemDelegateUnDelegateFromTopUpWithdraw(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + tpn := integrationTests.NewTestProcessorNode(integrationTests.ArgTestProcessorNode{ MaxShards: 1, NodeShardId: core.MetachainShardId, @@ -348,6 +366,10 @@ func TestDelegationSystemDelegateUnDelegateFromTopUpWithdraw(t *testing.T) { } func TestDelegationSystemDelegateUnDelegateOnlyPartOfDelegation(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + tpn := integrationTests.NewTestProcessorNode(integrationTests.ArgTestProcessorNode{ MaxShards: 1, NodeShardId: core.MetachainShardId, @@ -409,6 +431,10 @@ func TestDelegationSystemDelegateUnDelegateOnlyPartOfDelegation(t *testing.T) { } func TestDelegationSystemMultipleDelegationContractsAndSameBlsKeysShouldNotWork(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + tpn := integrationTests.NewTestProcessorNode(integrationTests.ArgTestProcessorNode{ MaxShards: 1, NodeShardId: core.MetachainShardId, @@ -483,6 +509,10 @@ func TestDelegationSystemMultipleDelegationContractsAndSameBlsKeysShouldNotWork( } func TestDelegationSystemMultipleDelegationContractsAndSameDelegators(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + tpn := integrationTests.NewTestProcessorNode(integrationTests.ArgTestProcessorNode{ MaxShards: 1, NodeShardId: core.MetachainShardId, @@ -551,6 +581,10 @@ func TestDelegationSystemMultipleDelegationContractsAndSameDelegators(t *testing } func TestDelegationRewardsComputationAfterChangeServiceFee(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + tpn := integrationTests.NewTestProcessorNode(integrationTests.ArgTestProcessorNode{ MaxShards: 1, NodeShardId: core.MetachainShardId, @@ -655,6 +689,10 @@ func TestDelegationRewardsComputationAfterChangeServiceFee(t *testing.T) { } func TestDelegationUnJail(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + tpn := integrationTests.NewTestProcessorNode(integrationTests.ArgTestProcessorNode{ MaxShards: 1, NodeShardId: core.MetachainShardId, @@ -718,6 +756,10 @@ func TestDelegationUnJail(t *testing.T) { } func TestDelegationSystemDelegateSameUsersAFewTimes(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + tpn := integrationTests.NewTestProcessorNode(integrationTests.ArgTestProcessorNode{ MaxShards: 1, NodeShardId: core.MetachainShardId, @@ -779,6 +821,10 @@ func TestDelegationSystemDelegateSameUsersAFewTimes(t *testing.T) { } func TestDelegationSystemMultipleDelegationContractsAndSameDelegatorsClaimRewardsMultipleTimeUndelegateClaimRewardsMultipleTime(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + tpn := integrationTests.NewTestProcessorNode(integrationTests.ArgTestProcessorNode{ MaxShards: 1, NodeShardId: core.MetachainShardId, @@ -931,6 +977,10 @@ func TestDelegationSystemMultipleDelegationContractsAndSameDelegatorsClaimReward } func TestDelegationSystemDelegateUnDelegateReceiveRewardsWhenAllIsUndelegated(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + tpn := integrationTests.NewTestProcessorNode(integrationTests.ArgTestProcessorNode{ MaxShards: 1, NodeShardId: core.MetachainShardId, @@ -1069,6 +1119,10 @@ func TestDelegationSystemDelegateUnDelegateReceiveRewardsWhenAllIsUndelegated(t } func TestDelegationSystemCleanUpContract(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + tpn := integrationTests.NewTestProcessorNode(integrationTests.ArgTestProcessorNode{ MaxShards: 1, NodeShardId: core.MetachainShardId, diff --git a/integrationTests/vm/delegation/delegation_test.go b/integrationTests/vm/delegation/delegation_test.go index 65ff98aab2f..9bae5235076 100644 --- a/integrationTests/vm/delegation/delegation_test.go +++ b/integrationTests/vm/delegation/delegation_test.go @@ -1,5 +1,3 @@ -//go:build !race - package delegation import ( diff --git a/integrationTests/vm/esdt/localFuncs/esdtLocalFunsSC_MockContracts_test.go b/integrationTests/vm/esdt/localFuncs/esdtLocalFunsSC_MockContracts_test.go index e5abb053058..c088215b3c0 100644 --- a/integrationTests/vm/esdt/localFuncs/esdtLocalFunsSC_MockContracts_test.go +++ b/integrationTests/vm/esdt/localFuncs/esdtLocalFunsSC_MockContracts_test.go @@ -1,5 +1,3 @@ -//go:build !race - package localFuncs import ( diff --git a/integrationTests/vm/esdt/localFuncs/esdtLocalFunsSC_test.go b/integrationTests/vm/esdt/localFuncs/esdtLocalFunsSC_test.go index c5e9da76d9b..742531fb801 100644 --- a/integrationTests/vm/esdt/localFuncs/esdtLocalFunsSC_test.go +++ b/integrationTests/vm/esdt/localFuncs/esdtLocalFunsSC_test.go @@ -1,5 +1,3 @@ -//go:build !race - package localFuncs import ( @@ -265,17 +263,22 @@ func TestESDTSetTransferRoles(t *testing.T) { } func TestESDTSetTransferRolesForwardAsyncCallFailsIntra(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testESDTWithTransferRoleAndForwarder(t, 1) } func TestESDTSetTransferRolesForwardAsyncCallFailsCross(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testESDTWithTransferRoleAndForwarder(t, 2) } func testESDTWithTransferRoleAndForwarder(t *testing.T, numShards int) { - if testing.Short() { - t.Skip("this is not a short test") - } nodes, idxProposers := esdtCommon.CreateNodesAndPrepareBalances(numShards) defer func() { @@ -325,18 +328,22 @@ func testESDTWithTransferRoleAndForwarder(t *testing.T, numShards int) { } func TestAsyncCallsAndCallBacksArgumentsIntra(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testAsyncCallAndCallBacksArguments(t, 1) } func TestAsyncCallsAndCallBacksArgumentsCross(t *testing.T) { - testAsyncCallAndCallBacksArguments(t, 2) -} - -func testAsyncCallAndCallBacksArguments(t *testing.T, numShards int) { if testing.Short() { t.Skip("this is not a short test") } + testAsyncCallAndCallBacksArguments(t, 2) +} + +func testAsyncCallAndCallBacksArguments(t *testing.T, numShards int) { nodes, idxProposers := esdtCommon.CreateNodesAndPrepareBalances(numShards) defer func() { for _, n := range nodes { diff --git a/integrationTests/vm/esdt/multisign/esdtMultisign_test.go b/integrationTests/vm/esdt/multisign/esdtMultisign_test.go index 42b2bcacbdc..2beb0fa319c 100644 --- a/integrationTests/vm/esdt/multisign/esdtMultisign_test.go +++ b/integrationTests/vm/esdt/multisign/esdtMultisign_test.go @@ -1,5 +1,3 @@ -//go:build !race - package multisign import ( diff --git a/integrationTests/vm/esdt/nft/esdtNFT/esdtNft_test.go b/integrationTests/vm/esdt/nft/esdtNFT/esdtNft_test.go index 99138f77ce5..a1db92372bd 100644 --- a/integrationTests/vm/esdt/nft/esdtNFT/esdtNft_test.go +++ b/integrationTests/vm/esdt/nft/esdtNFT/esdtNft_test.go @@ -1,5 +1,3 @@ -//go:build !race - package esdtNFT import ( @@ -908,6 +906,10 @@ func testESDTSemiFungibleTokenTransferRole(t *testing.T, numOfShards int) { } func TestESDTSFTWithEnhancedTransferRole(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + nodesPerShard := 2 numMetachainNodes := 2 numOfShards := 3 diff --git a/integrationTests/vm/esdt/nft/esdtNFTSCs/esdtNFTSCs_test.go b/integrationTests/vm/esdt/nft/esdtNFTSCs/esdtNFTSCs_test.go index 8f62294a776..534c1c7435e 100644 --- a/integrationTests/vm/esdt/nft/esdtNFTSCs/esdtNFTSCs_test.go +++ b/integrationTests/vm/esdt/nft/esdtNFTSCs/esdtNFTSCs_test.go @@ -1,5 +1,3 @@ -//go:build !race - package esdtNFTSCs import ( diff --git a/integrationTests/vm/esdt/process/esdtProcess_test.go b/integrationTests/vm/esdt/process/esdtProcess_test.go index d580847067a..113ea36a8f4 100644 --- a/integrationTests/vm/esdt/process/esdtProcess_test.go +++ b/integrationTests/vm/esdt/process/esdtProcess_test.go @@ -1,5 +1,3 @@ -//go:build !race - package process import ( @@ -331,6 +329,10 @@ func TestESDTIssueAndSelfTransferShouldNotChangeBalance(t *testing.T) { } func TestESDTIssueFromASmartContractSimulated(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + metaNode := integrationTests.NewTestProcessorNode(integrationTests.ArgTestProcessorNode{ MaxShards: 1, NodeShardId: core.MetachainShardId, @@ -876,133 +878,6 @@ func TestCallbackPaymentEgld(t *testing.T) { }) } -func TestScCallsScWithEsdtCrossShard(t *testing.T) { - t.Skip("test is not ready yet") - - numOfShards := 2 - nodesPerShard := 2 - numMetachainNodes := 2 - - nodes := integrationTests.CreateNodes( - numOfShards, - nodesPerShard, - numMetachainNodes, - ) - - idxProposers := make([]int, numOfShards+1) - for i := 0; i < numOfShards; i++ { - idxProposers[i] = i * nodesPerShard - } - idxProposers[numOfShards] = numOfShards * nodesPerShard - - integrationTests.DisplayAndStartNodes(nodes) - - defer func() { - for _, n := range nodes { - n.Close() - } - }() - - initialVal := big.NewInt(10000000000) - integrationTests.MintAllNodes(nodes, initialVal) - - round := uint64(0) - nonce := uint64(0) - round = integrationTests.IncrementAndPrintRound(round) - nonce++ - - // send token issue - - initialSupply := int64(10000000000) - ticker := "TCK" - esdtCommon.IssueTestToken(nodes, initialSupply, ticker) - tokenIssuer := nodes[0] - - time.Sleep(time.Second) - nrRoundsToPropagateMultiShard := 12 - nonce, round = integrationTests.WaitOperationToBeDone(t, nodes, nrRoundsToPropagateMultiShard, nonce, round, idxProposers) - time.Sleep(time.Second) - - tokenIdentifier := string(integrationTests.GetTokenIdentifier(nodes, []byte(ticker))) - esdtCommon.CheckAddressHasTokens(t, tokenIssuer.OwnAccount.Address, nodes, []byte(tokenIdentifier), 0, initialSupply) - - // deploy the smart contracts - - vaultCode := wasm.GetSCCode("../testdata/vault.wasm") - secondScAddress, _ := tokenIssuer.BlockchainHook.NewAddress(tokenIssuer.OwnAccount.Address, tokenIssuer.OwnAccount.Nonce, vmFactory.WasmVirtualMachine) - - integrationTests.CreateAndSendTransaction( - nodes[0], - nodes, - big.NewInt(0), - testVm.CreateEmptyAddress(), - wasm.CreateDeployTxData(vaultCode), - integrationTests.AdditionalGasLimit, - ) - - nonce, round = integrationTests.WaitOperationToBeDone(t, nodes, 4, nonce, round, idxProposers) - _, err := nodes[0].AccntState.GetExistingAccount(secondScAddress) - require.Nil(t, err) - - forwarderCode := wasm.GetSCCode("../testdata/forwarder-raw.wasm") - forwarder, _ := nodes[2].BlockchainHook.NewAddress(nodes[2].OwnAccount.Address, nodes[2].OwnAccount.Nonce, vmFactory.WasmVirtualMachine) - integrationTests.CreateAndSendTransaction( - nodes[2], - nodes, - big.NewInt(0), - testVm.CreateEmptyAddress(), - wasm.CreateDeployTxData(forwarderCode), - integrationTests.AdditionalGasLimit, - ) - - nonce, round = integrationTests.WaitOperationToBeDone(t, nodes, 4, nonce, round, idxProposers) - _, err = nodes[2].AccntState.GetExistingAccount(forwarder) - require.Nil(t, err) - - txData := txDataBuilder.NewBuilder() - - // call forwarder with esdt, and the forwarder automatically calls second sc - valueToSendToSc := int64(1000) - txData.Clear().TransferESDT(tokenIdentifier, valueToSendToSc) - txData.Str("forward_async_call_half_payment").Bytes(secondScAddress).Str("accept_funds") - integrationTests.CreateAndSendTransaction(tokenIssuer, nodes, big.NewInt(0), forwarder, txData.ToString(), integrationTests.AdditionalGasLimit) - - time.Sleep(time.Second) - nonce, round = integrationTests.WaitOperationToBeDone(t, nodes, nrRoundsToPropagateMultiShard, nonce, round, idxProposers) - time.Sleep(time.Second) - - esdtCommon.CheckAddressHasTokens(t, tokenIssuer.OwnAccount.Address, nodes, []byte(tokenIdentifier), 0, initialSupply-valueToSendToSc) - esdtCommon.CheckAddressHasTokens(t, forwarder, nodes, []byte(tokenIdentifier), 0, valueToSendToSc/2) - esdtCommon.CheckAddressHasTokens(t, secondScAddress, nodes, []byte(tokenIdentifier), 0, valueToSendToSc/2) - - esdtCommon.CheckNumCallBacks(t, forwarder, nodes, 1) - esdtCommon.CheckForwarderRawSavedCallbackArgs(t, forwarder, nodes, 1, vmcommon.Ok, [][]byte{}) - esdtCommon.CheckForwarderRawSavedCallbackPayments(t, forwarder, nodes, []*esdtCommon.ForwarderRawSavedPaymentInfo{}) - - // call forwarder to ask the second one to send it back some esdt - valueToRequest := valueToSendToSc / 4 - txData.Clear().Func("forward_async_call").Bytes(secondScAddress) - txData.Str("retrieve_funds").Str(tokenIdentifier).Int64(0).Int64(valueToRequest) - integrationTests.CreateAndSendTransaction(tokenIssuer, nodes, big.NewInt(0), forwarder, txData.ToString(), integrationTests.AdditionalGasLimit) - - time.Sleep(time.Second) - _, _ = integrationTests.WaitOperationToBeDone(t, nodes, nrRoundsToPropagateMultiShard, nonce, round, idxProposers) - time.Sleep(time.Second) - - esdtCommon.CheckAddressHasTokens(t, forwarder, nodes, []byte(tokenIdentifier), 0, valueToSendToSc*3/4) - esdtCommon.CheckAddressHasTokens(t, secondScAddress, nodes, []byte(tokenIdentifier), 0, valueToSendToSc/4) - - esdtCommon.CheckNumCallBacks(t, forwarder, nodes, 2) - esdtCommon.CheckForwarderRawSavedCallbackArgs(t, forwarder, nodes, 2, vmcommon.Ok, [][]byte{}) - esdtCommon.CheckForwarderRawSavedCallbackPayments(t, forwarder, nodes, []*esdtCommon.ForwarderRawSavedPaymentInfo{ - { - TokenId: "EGLD", - Nonce: 0, - Payment: big.NewInt(valueToSendToSc), - }, - }) -} - func TestScCallsScWithEsdtIntraShard_SecondScRefusesPayment(t *testing.T) { if testing.Short() { t.Skip("this is not a short test") diff --git a/integrationTests/vm/esdt/roles/esdtRoles_test.go b/integrationTests/vm/esdt/roles/esdtRoles_test.go index aa2834062c4..5c117ed4edd 100644 --- a/integrationTests/vm/esdt/roles/esdtRoles_test.go +++ b/integrationTests/vm/esdt/roles/esdtRoles_test.go @@ -1,5 +1,3 @@ -//go:build !race - package roles import ( diff --git a/integrationTests/vm/txsFee/asyncCall_multi_test.go b/integrationTests/vm/txsFee/asyncCall_multi_test.go index 289f440efa3..61886be4da3 100644 --- a/integrationTests/vm/txsFee/asyncCall_multi_test.go +++ b/integrationTests/vm/txsFee/asyncCall_multi_test.go @@ -1,5 +1,3 @@ -//go:build !race - package txsFee import ( @@ -23,6 +21,10 @@ var egldBalance = big.NewInt(50000000000) var esdtBalance = big.NewInt(100) func TestAsyncCallLegacy(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -66,6 +68,10 @@ func TestAsyncCallLegacy(t *testing.T) { } func TestAsyncCallMulti(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -113,6 +119,10 @@ func TestAsyncCallMulti(t *testing.T) { } func TestAsyncCallTransferAndExecute(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -164,6 +174,10 @@ func TestAsyncCallTransferAndExecute(t *testing.T) { } func TestAsyncCallTransferESDTAndExecute_Success(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + numberOfCallsFromParent := 3 numberOfBackTransfers := 2 transferESDTAndExecute(t, numberOfCallsFromParent, numberOfBackTransfers) @@ -280,6 +294,10 @@ func deployForwarderAndTestContract( } func TestAsyncCallMulti_CrossShard(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContextFirstContract, err := vm.CreatePreparedTxProcessorWithVMsMultiShard(0, config.EnableEpochs{}) require.Nil(t, err) defer testContextFirstContract.Close() @@ -366,6 +384,10 @@ func TestAsyncCallMulti_CrossShard(t *testing.T) { } func TestAsyncCallTransferAndExecute_CrossShard(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + childShard, err := vm.CreatePreparedTxProcessorWithVMsMultiShard(0, config.EnableEpochs{}) require.Nil(t, err) defer childShard.Close() @@ -448,6 +470,10 @@ func TestAsyncCallTransferAndExecute_CrossShard(t *testing.T) { } func TestAsyncCallTransferESDTAndExecute_CrossShard_Success(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + numberOfCallsFromParent := 3 numberOfBackTransfers := 2 transferESDTAndExecuteCrossShard(t, numberOfCallsFromParent, numberOfBackTransfers) diff --git a/integrationTests/vm/txsFee/asyncCall_test.go b/integrationTests/vm/txsFee/asyncCall_test.go index 78030ff6b39..19a966e2fa8 100644 --- a/integrationTests/vm/txsFee/asyncCall_test.go +++ b/integrationTests/vm/txsFee/asyncCall_test.go @@ -1,14 +1,9 @@ -//go:build !race - -// TODO remove build condition above to allow -race -short, after Wasm VM fix - package txsFee import ( "encoding/hex" "fmt" "math/big" - "runtime" "strings" "testing" @@ -34,6 +29,10 @@ import ( const upgradeContractFunction = "upgradeContract" func TestAsyncCallShouldWork(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -86,6 +85,10 @@ func TestAsyncCallShouldWork(t *testing.T) { } func TestMinterContractWithAsyncCalls(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMsAndCustomGasSchedule(config.EnableEpochs{}, func(gasMap wasmConfig.GasScheduleMap) { // if `MaxBuiltInCallsPerTx` is 200 test will fail gasMap[common.MaxPerTransaction]["MaxBuiltInCallsPerTx"] = 199 @@ -142,8 +145,8 @@ func TestMinterContractWithAsyncCalls(t *testing.T) { } func TestAsyncCallsOnInitFunctionOnUpgrade(t *testing.T) { - if runtime.GOARCH == "arm64" { - t.Skip("skipping test on arm64") + if testing.Short() { + t.Skip("this is not a short test") } firstContractCode := wasm.GetSCCode("./testdata/first/output/first.wasm") @@ -281,8 +284,8 @@ func testAsyncCallsOnInitFunctionOnUpgrade( } func TestAsyncCallsOnInitFunctionOnDeploy(t *testing.T) { - if runtime.GOARCH == "arm64" { - t.Skip("skipping test on arm64") + if testing.Short() { + t.Skip("this is not a short test") } firstSCCode := wasm.GetSCCode("./testdata/first/output/first.wasm") diff --git a/integrationTests/vm/txsFee/asyncESDT_test.go b/integrationTests/vm/txsFee/asyncESDT_test.go index 2c2dfce4c71..289926f96db 100644 --- a/integrationTests/vm/txsFee/asyncESDT_test.go +++ b/integrationTests/vm/txsFee/asyncESDT_test.go @@ -1,7 +1,3 @@ -//go:build !race - -// TODO remove build condition above to allow -race -short, after Wasm VM fix - package txsFee import ( @@ -25,6 +21,10 @@ import ( ) func TestAsyncESDTCallShouldWork(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{ DynamicGasCostForDataTrieStorageLoadEnableEpoch: integrationTests.UnreachableEpoch, }) @@ -79,6 +79,10 @@ func TestAsyncESDTCallShouldWork(t *testing.T) { } func TestAsyncESDTCallSecondScRefusesPayment(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -132,6 +136,10 @@ func TestAsyncESDTCallSecondScRefusesPayment(t *testing.T) { } func TestAsyncESDTCallsOutOfGas(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -184,6 +192,10 @@ func TestAsyncESDTCallsOutOfGas(t *testing.T) { } func TestAsyncMultiTransferOnCallback(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{ DynamicGasCostForDataTrieStorageLoadEnableEpoch: integrationTests.UnreachableEpoch, }) @@ -279,6 +291,10 @@ func TestAsyncMultiTransferOnCallback(t *testing.T) { } func TestAsyncMultiTransferOnCallAndOnCallback(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -379,6 +395,10 @@ func TestAsyncMultiTransferOnCallAndOnCallback(t *testing.T) { } func TestSendNFTToContractWith0Function(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -428,6 +448,10 @@ func TestSendNFTToContractWith0Function(t *testing.T) { } func TestSendNFTToContractWith0FunctionNonPayable(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -478,6 +502,10 @@ func TestSendNFTToContractWith0FunctionNonPayable(t *testing.T) { } func TestAsyncESDTCallForThirdContractShouldWork(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMsMultiShard(0, config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() diff --git a/integrationTests/vm/txsFee/builtInFunctions_test.go b/integrationTests/vm/txsFee/builtInFunctions_test.go index 3f5bec54e51..8bd8c80db0f 100644 --- a/integrationTests/vm/txsFee/builtInFunctions_test.go +++ b/integrationTests/vm/txsFee/builtInFunctions_test.go @@ -1,7 +1,3 @@ -//go:build !race - -// TODO remove build condition above to allow -race -short, after Wasm VM fix - package txsFee import ( @@ -28,6 +24,10 @@ import ( ) func TestBuildInFunctionChangeOwnerCallShouldWorkV1(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs( config.EnableEpochs{ PenalizedTooMuchGasEnableEpoch: integrationTests.UnreachableEpoch, diff --git a/integrationTests/vm/txsFee/dns_test.go b/integrationTests/vm/txsFee/dns_test.go index 6a2b9315162..a859341d1d4 100644 --- a/integrationTests/vm/txsFee/dns_test.go +++ b/integrationTests/vm/txsFee/dns_test.go @@ -1,14 +1,9 @@ -//go:build !race - -// TODO remove build condition above to allow -race -short, after Wasm VM fix - package txsFee import ( "encoding/hex" "fmt" "math/big" - "runtime" "testing" "unicode/utf8" @@ -30,6 +25,10 @@ import ( const returnOkData = "@6f6b" func TestDeployDNSContract_TestRegisterAndResolveAndSendTxWithSndAndRcvUserName(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{ DynamicGasCostForDataTrieStorageLoadEnableEpoch: 10, }) @@ -117,8 +116,8 @@ func TestDeployDNSContract_TestRegisterAndResolveAndSendTxWithSndAndRcvUserName( // relayer address is in shard 2, creates a transaction on the behalf of the user from shard 2, that will call the DNS contract // from shard 1. func TestDeployDNSContract_TestGasWhenSaveUsernameFailsCrossShardBackwardsCompatibility(t *testing.T) { - if runtime.GOARCH == "arm64" { - t.Skip("skipping test on arm64") + if testing.Short() { + t.Skip("this is not a short test") } enableEpochs := config.EnableEpochs{ @@ -197,6 +196,10 @@ func TestDeployDNSContract_TestGasWhenSaveUsernameFailsCrossShardBackwardsCompat } func TestDeployDNSContract_TestGasWhenSaveUsernameAfterDNSv2IsActivated(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContextForDNSContract, err := vm.CreatePreparedTxProcessorWithVMsMultiShard(1, config.EnableEpochs{ DynamicGasCostForDataTrieStorageLoadEnableEpoch: integrationTests.UnreachableEpoch, }) diff --git a/integrationTests/vm/txsFee/dynamicGasCost_test.go b/integrationTests/vm/txsFee/dynamicGasCost_test.go index a8c8a8eb9eb..e1fca367f3f 100644 --- a/integrationTests/vm/txsFee/dynamicGasCost_test.go +++ b/integrationTests/vm/txsFee/dynamicGasCost_test.go @@ -1,7 +1,3 @@ -//go:build !race - -// TODO remove build condition above to allow -race -short, after Wasm VM fix - package txsFee import ( @@ -23,6 +19,10 @@ import ( ) func TestDynamicGasCostForDataTrieStorageLoad(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + enableEpochs := config.EnableEpochs{ DynamicGasCostForDataTrieStorageLoadEnableEpoch: 0, } diff --git a/integrationTests/vm/txsFee/guardAccount_test.go b/integrationTests/vm/txsFee/guardAccount_test.go index 58542a72e79..6ccde4df164 100644 --- a/integrationTests/vm/txsFee/guardAccount_test.go +++ b/integrationTests/vm/txsFee/guardAccount_test.go @@ -1,7 +1,3 @@ -//go:build !race - -// TODO remove build condition above to allow -race -short, after Wasm VM fix - package txsFee import ( @@ -350,6 +346,10 @@ func setNewEpochOnContext(testContext *vm.VMTestContext, epoch uint32) { } func TestGuardAccount_ShouldErrorIfInstantSetIsDoneOnANotProtectedAccount(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext := prepareTestContextForGuardedAccounts(t) defer testContext.Close() @@ -367,6 +367,10 @@ func TestGuardAccount_ShouldErrorIfInstantSetIsDoneOnANotProtectedAccount(t *tes } func TestGuardAccount_ShouldSetGuardianOnANotProtectedAccount(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext := prepareTestContextForGuardedAccounts(t) defer testContext.Close() @@ -467,6 +471,10 @@ func TestGuardAccount_ShouldSetGuardianOnANotProtectedAccount(t *testing.T) { } func TestGuardAccount_SendingFundsWhileProtectedAndNotProtected(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext := prepareTestContextForGuardedAccounts(t) defer testContext.Close() @@ -592,6 +600,10 @@ func TestGuardAccount_SendingFundsWhileProtectedAndNotProtected(t *testing.T) { // 14. alice un-guards the accounts immediately using a cosigned transaction and then sends a guarded transaction -> should error // 14.1 alice sends unguarded transaction -> should work func TestGuardAccount_Scenario1(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext := prepareTestContextForGuardedAccounts(t) defer testContext.Close() @@ -916,6 +928,10 @@ func TestGuardAccount_Scenario1(t *testing.T) { // 3.1 cosigned transaction should work // 3.2 single signed transaction should not work func TestGuardAccounts_RelayedTransactionV1(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext := prepareTestContextForGuardedAccounts(t) defer testContext.Close() @@ -1036,6 +1052,10 @@ func TestGuardAccounts_RelayedTransactionV1(t *testing.T) { // 3.1 cosigned transaction should not work // 3.2 single signed transaction should not work func TestGuardAccounts_RelayedTransactionV2(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext := prepareTestContextForGuardedAccounts(t) defer testContext.Close() diff --git a/integrationTests/vm/txsFee/migrateDataTrie_test.go b/integrationTests/vm/txsFee/migrateDataTrie_test.go index 9c62a4f30fd..02eecc0e1c3 100644 --- a/integrationTests/vm/txsFee/migrateDataTrie_test.go +++ b/integrationTests/vm/txsFee/migrateDataTrie_test.go @@ -1,7 +1,3 @@ -//go:build !race - -// TODO remove build condition above to allow -race -short, after Wasm VM fix - package txsFee import ( @@ -31,7 +27,9 @@ type dataTrie interface { } func TestMigrateDataTrieBuiltInFunc(t *testing.T) { - t.Parallel() + if testing.Short() { + t.Skip("this is not a short test") + } enableEpochs := config.EnableEpochs{ AutoBalanceDataTriesEnableEpoch: 0, diff --git a/integrationTests/vm/txsFee/multiShard/asyncCall_test.go b/integrationTests/vm/txsFee/multiShard/asyncCall_test.go index e799fd3efc6..9a0297de698 100644 --- a/integrationTests/vm/txsFee/multiShard/asyncCall_test.go +++ b/integrationTests/vm/txsFee/multiShard/asyncCall_test.go @@ -1,5 +1,3 @@ -//go:build !race - package multiShard import ( @@ -17,9 +15,8 @@ import ( ) func TestAsyncCallShouldWork(t *testing.T) { - // TODO reinstate test after Wasm VM pointer fix if testing.Short() { - t.Skip("cannot run with -race -short; requires Wasm VM fix") + t.Skip("this is not a short test") } enableEpochs := config.EnableEpochs{ @@ -119,7 +116,7 @@ func TestAsyncCallShouldWork(t *testing.T) { func TestAsyncCallDisabled(t *testing.T) { if testing.Short() { - t.Skip("cannot run with -race -short; requires Arwen fix") + t.Skip("this is not a short test") } enableEpochs := config.EnableEpochs{ diff --git a/integrationTests/vm/txsFee/multiShard/asyncESDT_test.go b/integrationTests/vm/txsFee/multiShard/asyncESDT_test.go index 114859ac5bf..e7d78430350 100644 --- a/integrationTests/vm/txsFee/multiShard/asyncESDT_test.go +++ b/integrationTests/vm/txsFee/multiShard/asyncESDT_test.go @@ -1,7 +1,3 @@ -//go:build !race - -// TODO remove build condition above to allow -race -short, after Wasm VM fix - package multiShard import ( @@ -18,6 +14,10 @@ import ( ) func TestAsyncESDTTransferWithSCCallShouldWork(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + enableEpochs := config.EnableEpochs{ DynamicGasCostForDataTrieStorageLoadEnableEpoch: integrationTests.UnreachableEpoch, } @@ -130,6 +130,10 @@ func TestAsyncESDTTransferWithSCCallShouldWork(t *testing.T) { } func TestAsyncESDTTransferWithSCCallSecondContractAnotherToken(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + enableEpochs := config.EnableEpochs{ DynamicGasCostForDataTrieStorageLoadEnableEpoch: integrationTests.UnreachableEpoch, } diff --git a/integrationTests/vm/txsFee/multiShard/relayedScDeploy_test.go b/integrationTests/vm/txsFee/multiShard/relayedScDeploy_test.go index 499fbe5c6ee..7700c55b0f4 100644 --- a/integrationTests/vm/txsFee/multiShard/relayedScDeploy_test.go +++ b/integrationTests/vm/txsFee/multiShard/relayedScDeploy_test.go @@ -1,5 +1,3 @@ -//go:build !race - package multiShard import ( @@ -16,6 +14,10 @@ import ( ) func TestRelayedSCDeployShouldWork(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContextRelayer, err := vm.CreatePreparedTxProcessorWithVMsMultiShard(2, config.EnableEpochs{}) require.Nil(t, err) defer testContextRelayer.Close() diff --git a/integrationTests/vm/txsFee/multiShard/relayedTxScCalls_test.go b/integrationTests/vm/txsFee/multiShard/relayedTxScCalls_test.go index 8e0229fef08..4e0f0d983fa 100644 --- a/integrationTests/vm/txsFee/multiShard/relayedTxScCalls_test.go +++ b/integrationTests/vm/txsFee/multiShard/relayedTxScCalls_test.go @@ -1,7 +1,3 @@ -//go:build !race - -// TODO remove build condition above to allow -race -short, after Wasm VM fix - package multiShard import ( @@ -27,6 +23,10 @@ import ( // 4. Execute SCR with the smart contract call on shard 1 // 5. Execute SCR with refund on relayer shard (shard 2) func TestRelayedTxScCallMultiShardShouldWork(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + enableEpochs := config.EnableEpochs{ DynamicGasCostForDataTrieStorageLoadEnableEpoch: integrationTests.UnreachableEpoch, } @@ -136,6 +136,10 @@ func TestRelayedTxScCallMultiShardShouldWork(t *testing.T) { } func TestRelayedTxScCallMultiShardFailOnInnerTxDst(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContextRelayer, err := vm.CreatePreparedTxProcessorWithVMsMultiShard(2, config.EnableEpochs{}) require.Nil(t, err) defer testContextRelayer.Close() diff --git a/integrationTests/vm/txsFee/multiShard/scCallWithValueTransfer_test.go b/integrationTests/vm/txsFee/multiShard/scCallWithValueTransfer_test.go index bcb14308bab..8f66a649a3b 100644 --- a/integrationTests/vm/txsFee/multiShard/scCallWithValueTransfer_test.go +++ b/integrationTests/vm/txsFee/multiShard/scCallWithValueTransfer_test.go @@ -1,5 +1,3 @@ -//go:build !race - package multiShard import ( @@ -16,10 +14,18 @@ import ( ) func TestDeployContractAndTransferValueSCProcessorV1(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testDeployContractAndTransferValue(t, 1000) } func TestDeployContractAndTransferValueSCProcessorV2(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testDeployContractAndTransferValue(t, 0) } diff --git a/integrationTests/vm/txsFee/multiShard/scCalls_test.go b/integrationTests/vm/txsFee/multiShard/scCalls_test.go index 42e1dc824c1..1338e280c65 100644 --- a/integrationTests/vm/txsFee/multiShard/scCalls_test.go +++ b/integrationTests/vm/txsFee/multiShard/scCalls_test.go @@ -1,7 +1,3 @@ -//go:build !race - -// TODO remove build condition above to allow -race -short, after Wasm VM fix - package multiShard import ( @@ -17,6 +13,10 @@ import ( ) func TestScCallExecuteOnSourceAndDstShardShouldWork(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + enableEpochs := config.EnableEpochs{ DynamicGasCostForDataTrieStorageLoadEnableEpoch: integrationTests.UnreachableEpoch, } @@ -97,6 +97,10 @@ func TestScCallExecuteOnSourceAndDstShardShouldWork(t *testing.T) { } func TestScCallExecuteOnSourceAndDstShardInvalidOnDst(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContextSource, err := vm.CreatePreparedTxProcessorWithVMsMultiShard(0, config.EnableEpochs{}) require.Nil(t, err) defer testContextSource.Close() diff --git a/integrationTests/vm/txsFee/relayedAsyncCall_test.go b/integrationTests/vm/txsFee/relayedAsyncCall_test.go index b782f318432..d98a440b648 100644 --- a/integrationTests/vm/txsFee/relayedAsyncCall_test.go +++ b/integrationTests/vm/txsFee/relayedAsyncCall_test.go @@ -1,7 +1,3 @@ -//go:build !race - -// TODO remove build condition above to allow -race -short, after Wasm VM fix - package txsFee import ( @@ -19,6 +15,10 @@ import ( ) func TestRelayedAsyncCallShouldWork(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + senderAddr := []byte("12345678901234567890123456789011") t.Run("nonce fix is disabled, should increase the sender's nonce", func(t *testing.T) { diff --git a/integrationTests/vm/txsFee/relayedAsyncESDT_test.go b/integrationTests/vm/txsFee/relayedAsyncESDT_test.go index 061a884b268..5e3ca24d999 100644 --- a/integrationTests/vm/txsFee/relayedAsyncESDT_test.go +++ b/integrationTests/vm/txsFee/relayedAsyncESDT_test.go @@ -1,7 +1,3 @@ -//go:build !race - -// TODO remove build condition above to allow -race -short, after Wasm VM fix - package txsFee import ( @@ -18,6 +14,10 @@ import ( ) func TestRelayedAsyncESDTCallShouldWork(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{ DynamicGasCostForDataTrieStorageLoadEnableEpoch: integrationTests.UnreachableEpoch, }) @@ -78,6 +78,10 @@ func TestRelayedAsyncESDTCallShouldWork(t *testing.T) { } func TestRelayedAsyncESDTCall_InvalidCallFirstContract(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -136,6 +140,10 @@ func TestRelayedAsyncESDTCall_InvalidCallFirstContract(t *testing.T) { } func TestRelayedAsyncESDTCall_InvalidOutOfGas(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() diff --git a/integrationTests/vm/txsFee/relayedBuiltInFunctions_test.go b/integrationTests/vm/txsFee/relayedBuiltInFunctions_test.go index dd82f276e27..115dc545244 100644 --- a/integrationTests/vm/txsFee/relayedBuiltInFunctions_test.go +++ b/integrationTests/vm/txsFee/relayedBuiltInFunctions_test.go @@ -1,7 +1,3 @@ -//go:build !race - -// TODO remove build condition above to allow -race -short, after Wasm VM fix - package txsFee import ( @@ -20,6 +16,10 @@ import ( ) func TestRelayedBuildInFunctionChangeOwnerCallShouldWork(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs( config.EnableEpochs{ PenalizedTooMuchGasEnableEpoch: integrationTests.UnreachableEpoch, @@ -68,6 +68,10 @@ func TestRelayedBuildInFunctionChangeOwnerCallShouldWork(t *testing.T) { } func TestRelayedBuildInFunctionChangeOwnerCallWrongOwnerShouldConsumeGas(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -114,6 +118,10 @@ func TestRelayedBuildInFunctionChangeOwnerCallWrongOwnerShouldConsumeGas(t *test } func TestRelayedBuildInFunctionChangeOwnerInvalidAddressShouldConsumeGas(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -158,6 +166,10 @@ func TestRelayedBuildInFunctionChangeOwnerInvalidAddressShouldConsumeGas(t *test } func TestRelayedBuildInFunctionChangeOwnerCallInsufficientGasLimitShouldConsumeGas(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + t.Run("nonce fix is disabled, should increase the sender's nonce", func(t *testing.T) { testRelayedBuildInFunctionChangeOwnerCallInsufficientGasLimitShouldConsumeGas(t, config.EnableEpochs{ @@ -220,6 +232,10 @@ func testRelayedBuildInFunctionChangeOwnerCallInsufficientGasLimitShouldConsumeG } func TestRelayedBuildInFunctionChangeOwnerCallOutOfGasShouldConsumeGas(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() diff --git a/integrationTests/vm/txsFee/relayedDns_test.go b/integrationTests/vm/txsFee/relayedDns_test.go index e71c02622f1..54c70be0ee8 100644 --- a/integrationTests/vm/txsFee/relayedDns_test.go +++ b/integrationTests/vm/txsFee/relayedDns_test.go @@ -1,7 +1,3 @@ -//go:build !race - -// TODO remove build condition above to allow -race -short, after Wasm VM fix - package txsFee import ( @@ -18,6 +14,10 @@ import ( ) func TestRelayedTxDnsTransaction_ShouldWork(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() diff --git a/integrationTests/vm/txsFee/relayedESDT_test.go b/integrationTests/vm/txsFee/relayedESDT_test.go index eba6eedb384..c9837fb7075 100644 --- a/integrationTests/vm/txsFee/relayedESDT_test.go +++ b/integrationTests/vm/txsFee/relayedESDT_test.go @@ -1,7 +1,3 @@ -//go:build !race - -// TODO remove build condition above to allow -race -short, after Wasm VM fix - package txsFee import ( @@ -17,6 +13,10 @@ import ( ) func TestRelayedESDTTransferShouldWork(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -62,6 +62,10 @@ func TestRelayedESDTTransferShouldWork(t *testing.T) { } func TestTestRelayedESTTransferNotEnoughESTValueShouldConsumeGas(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() diff --git a/integrationTests/vm/txsFee/relayedScCalls_test.go b/integrationTests/vm/txsFee/relayedScCalls_test.go index d5e0e46179e..36febda356e 100644 --- a/integrationTests/vm/txsFee/relayedScCalls_test.go +++ b/integrationTests/vm/txsFee/relayedScCalls_test.go @@ -1,7 +1,3 @@ -//go:build !race - -// TODO remove build condition above to allow -race -short, after Wasm VM fix - package txsFee import ( @@ -19,6 +15,10 @@ import ( ) func TestRelayedScCallShouldWork(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{ DynamicGasCostForDataTrieStorageLoadEnableEpoch: integrationTests.UnreachableEpoch, }) @@ -63,6 +63,10 @@ func TestRelayedScCallShouldWork(t *testing.T) { } func TestRelayedScCallContractNotFoundShouldConsumeGas(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -102,6 +106,10 @@ func TestRelayedScCallContractNotFoundShouldConsumeGas(t *testing.T) { } func TestRelayedScCallInvalidMethodShouldConsumeGas(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -141,6 +149,10 @@ func TestRelayedScCallInvalidMethodShouldConsumeGas(t *testing.T) { } func TestRelayedScCallInsufficientGasLimitShouldConsumeGas(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -179,6 +191,10 @@ func TestRelayedScCallInsufficientGasLimitShouldConsumeGas(t *testing.T) { } func TestRelayedScCallOutOfGasShouldConsumeGas(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -218,6 +234,10 @@ func TestRelayedScCallOutOfGasShouldConsumeGas(t *testing.T) { } func TestRelayedDeployInvalidContractShouldIncrementNonceOnSender(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + senderAddr := []byte("12345678901234567890123456789011") t.Run("nonce fix is disabled, should increase the sender's nonce if inner tx has correct nonce", func(t *testing.T) { diff --git a/integrationTests/vm/txsFee/relayedScDeploy_test.go b/integrationTests/vm/txsFee/relayedScDeploy_test.go index 8a8f7f52d8c..15d6d677b44 100644 --- a/integrationTests/vm/txsFee/relayedScDeploy_test.go +++ b/integrationTests/vm/txsFee/relayedScDeploy_test.go @@ -1,7 +1,3 @@ -//go:build !race - -// TODO remove build condition above to allow -race -short, after Wasm VM fix - package txsFee import ( @@ -17,6 +13,10 @@ import ( ) func TestRelayedScDeployShouldWork(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -57,6 +57,10 @@ func TestRelayedScDeployShouldWork(t *testing.T) { } func TestRelayedScDeployInvalidCodeShouldConsumeGas(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -98,6 +102,10 @@ func TestRelayedScDeployInvalidCodeShouldConsumeGas(t *testing.T) { } func TestRelayedScDeployInsufficientGasLimitShouldConsumeGas(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -137,6 +145,10 @@ func TestRelayedScDeployInsufficientGasLimitShouldConsumeGas(t *testing.T) { } func TestRelayedScDeployOutOfGasShouldConsumeGas(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() diff --git a/integrationTests/vm/txsFee/scCalls_test.go b/integrationTests/vm/txsFee/scCalls_test.go index a4529d959a2..2a523825f96 100644 --- a/integrationTests/vm/txsFee/scCalls_test.go +++ b/integrationTests/vm/txsFee/scCalls_test.go @@ -1,7 +1,3 @@ -//go:build !race - -// TODO remove build condition above to allow -race -short, after Wasm VM fix - package txsFee import ( @@ -90,6 +86,10 @@ func prepareTestContextForEpoch836(tb testing.TB) (*vm.VMTestContext, []byte) { } func TestScCallShouldWork(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{ DynamicGasCostForDataTrieStorageLoadEnableEpoch: integrationTests.UnreachableEpoch, }) @@ -134,6 +134,10 @@ func TestScCallShouldWork(t *testing.T) { } func TestScCallContractNotFoundShouldConsumeGas(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -163,6 +167,10 @@ func TestScCallContractNotFoundShouldConsumeGas(t *testing.T) { } func TestScCallInvalidMethodToCallShouldConsumeGas(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -196,6 +204,10 @@ func TestScCallInvalidMethodToCallShouldConsumeGas(t *testing.T) { } func TestScCallInsufficientGasLimitShouldNotConsumeGas(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -230,6 +242,10 @@ func TestScCallInsufficientGasLimitShouldNotConsumeGas(t *testing.T) { } func TestScCallOutOfGasShouldConsumeGas(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -263,6 +279,10 @@ func TestScCallOutOfGasShouldConsumeGas(t *testing.T) { } func TestScCallAndGasChangeShouldWork(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{ DynamicGasCostForDataTrieStorageLoadEnableEpoch: integrationTests.UnreachableEpoch, }) @@ -308,6 +328,10 @@ func TestScCallAndGasChangeShouldWork(t *testing.T) { } func TestESDTScCallAndGasChangeShouldWork(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -418,6 +442,10 @@ func prepareTestContextForEpoch460(tb testing.TB) (*vm.VMTestContext, []byte) { } func TestScCallBuyNFT_OneFailedTxAndOneOkTx(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, scAddress := prepareTestContextForEpoch460(t) defer testContext.Close() @@ -487,6 +515,10 @@ func TestScCallBuyNFT_OneFailedTxAndOneOkTx(t *testing.T) { } func TestScCallBuyNFT_TwoOkTxs(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, scAddress := prepareTestContextForEpoch460(t) defer testContext.Close() @@ -556,6 +588,10 @@ func TestScCallBuyNFT_TwoOkTxs(t *testing.T) { } func TestScCallDistributeStakingRewards_ShouldWork(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, scAddress := prepareTestContextForEpoch836(t) defer testContext.Close() diff --git a/integrationTests/vm/txsFee/scDeploy_test.go b/integrationTests/vm/txsFee/scDeploy_test.go index 875fde2fe58..8410bcf4917 100644 --- a/integrationTests/vm/txsFee/scDeploy_test.go +++ b/integrationTests/vm/txsFee/scDeploy_test.go @@ -1,7 +1,3 @@ -//go:build !race - -// TODO remove build condition above to allow -race -short, after Wasm VM fix - package txsFee import ( @@ -17,6 +13,10 @@ import ( ) func TestScDeployShouldWork(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -48,6 +48,10 @@ func TestScDeployShouldWork(t *testing.T) { } func TestScDeployInvalidContractCodeShouldConsumeGas(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -80,6 +84,10 @@ func TestScDeployInvalidContractCodeShouldConsumeGas(t *testing.T) { } func TestScDeployInsufficientGasLimitShouldNotConsumeGas(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -111,6 +119,10 @@ func TestScDeployInsufficientGasLimitShouldNotConsumeGas(t *testing.T) { } func TestScDeployOutOfGasShouldConsumeGas(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() diff --git a/integrationTests/vm/wasm/badcontracts/badcontracts_test.go b/integrationTests/vm/wasm/badcontracts/badcontracts_test.go index e4b3b1b7ab7..ccf211853b8 100644 --- a/integrationTests/vm/wasm/badcontracts/badcontracts_test.go +++ b/integrationTests/vm/wasm/badcontracts/badcontracts_test.go @@ -1,5 +1,3 @@ -//go:build !race - package badcontracts import ( @@ -11,9 +9,8 @@ import ( ) func Test_Bad_C_NoPanic(t *testing.T) { - // TODO reinstate test after Wasm VM pointer fix if testing.Short() { - t.Skip("cannot run with -race -short; requires Wasm VM fix") + t.Skip("this is not a short test") } context := wasm.SetupTestContext(t) diff --git a/integrationTests/vm/wasm/delegation/delegationSimulation_test.go b/integrationTests/vm/wasm/delegation/delegationSimulation_test.go index be67b8d32b1..55be9681586 100644 --- a/integrationTests/vm/wasm/delegation/delegationSimulation_test.go +++ b/integrationTests/vm/wasm/delegation/delegationSimulation_test.go @@ -1,5 +1,3 @@ -//go:build !race - package delegation import ( diff --git a/integrationTests/vm/wasm/delegation/delegation_test.go b/integrationTests/vm/wasm/delegation/delegation_test.go index 9f4d3501c1c..9e9f394122f 100644 --- a/integrationTests/vm/wasm/delegation/delegation_test.go +++ b/integrationTests/vm/wasm/delegation/delegation_test.go @@ -1,5 +1,3 @@ -//go:build !race - package delegation import ( @@ -33,9 +31,8 @@ var NewBalanceBig = wasm.NewBalanceBig var RequireAlmostEquals = wasm.RequireAlmostEquals func TestDelegation_Claims(t *testing.T) { - // TODO reinstate test after Wasm VM pointer fix if testing.Short() { - t.Skip("cannot run with -race -short; requires Wasm VM fix") + t.Skip("this is not a short test") } context := wasm.SetupTestContext(t) diff --git a/integrationTests/vm/wasm/erc20/erc20_test.go b/integrationTests/vm/wasm/erc20/erc20_test.go index 7eed879eb50..ef4f45bf02c 100644 --- a/integrationTests/vm/wasm/erc20/erc20_test.go +++ b/integrationTests/vm/wasm/erc20/erc20_test.go @@ -1,5 +1,3 @@ -//go:build !race - package erc20 import ( @@ -10,9 +8,8 @@ import ( ) func Test_C_001(t *testing.T) { - // TODO reinstate test after Wasm VM pointer fix if testing.Short() { - t.Skip("cannot run with -race -short; requires Wasm VM fix") + t.Skip("this is not a short test") } context := wasm.SetupTestContext(t) diff --git a/integrationTests/vm/wasm/queries/queries_test.go b/integrationTests/vm/wasm/queries/queries_test.go index 7c51f04b325..e83170e6e0b 100644 --- a/integrationTests/vm/wasm/queries/queries_test.go +++ b/integrationTests/vm/wasm/queries/queries_test.go @@ -1,7 +1,3 @@ -//go:build !race - -// TODO remove build condition above to allow -race -short, after Wasm VM fix - package queries import ( diff --git a/integrationTests/vm/wasm/transfers/transfers_test.go b/integrationTests/vm/wasm/transfers/transfers_test.go index 98e0a416a89..63e4b120f02 100644 --- a/integrationTests/vm/wasm/transfers/transfers_test.go +++ b/integrationTests/vm/wasm/transfers/transfers_test.go @@ -1,5 +1,3 @@ -//go:build !race - package transfers import ( @@ -13,6 +11,10 @@ import ( ) func TestTransfers_DuplicatedTransferValueEvents(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + context := wasm.SetupTestContext(t) defer context.Close() diff --git a/integrationTests/vm/wasm/upgrades/upgrades_test.go b/integrationTests/vm/wasm/upgrades/upgrades_test.go index 514507b0c04..4a01b67a4ec 100644 --- a/integrationTests/vm/wasm/upgrades/upgrades_test.go +++ b/integrationTests/vm/wasm/upgrades/upgrades_test.go @@ -1,7 +1,3 @@ -//go:build !race - -// TODO remove build condition above to allow -race -short, after Wasm VM fix - package upgrades import ( @@ -19,6 +15,10 @@ import ( ) func TestUpgrades_Hello(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + context := wasm.SetupTestContext(t) defer context.Close() @@ -43,6 +43,10 @@ func TestUpgrades_Hello(t *testing.T) { } func TestUpgrades_HelloDoesNotUpgradeWhenNotUpgradeable(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + context := wasm.SetupTestContext(t) defer context.Close() @@ -61,6 +65,10 @@ func TestUpgrades_HelloDoesNotUpgradeWhenNotUpgradeable(t *testing.T) { } func TestUpgrades_HelloUpgradesToNotUpgradeable(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + context := wasm.SetupTestContext(t) defer context.Close() @@ -86,6 +94,10 @@ func TestUpgrades_HelloUpgradesToNotUpgradeable(t *testing.T) { } func TestUpgrades_ParentAndChildContracts(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + context := wasm.SetupTestContext(t) defer context.Close() @@ -125,6 +137,10 @@ func TestUpgrades_ParentAndChildContracts(t *testing.T) { } func TestUpgrades_HelloCannotBeUpgradedByNonOwner(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + context := wasm.SetupTestContext(t) defer context.Close() @@ -145,6 +161,10 @@ func TestUpgrades_HelloCannotBeUpgradedByNonOwner(t *testing.T) { } func TestUpgrades_CounterCannotBeUpgradedByNonOwner(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + context := wasm.SetupTestContext(t) defer context.Close() diff --git a/integrationTests/vm/wasm/wasmer/wasmer_test.go b/integrationTests/vm/wasm/wasmer/wasmer_test.go index f73bceae6b5..d7eeb9260a4 100644 --- a/integrationTests/vm/wasm/wasmer/wasmer_test.go +++ b/integrationTests/vm/wasm/wasmer/wasmer_test.go @@ -1,7 +1,3 @@ -//go:build !race - -// TODO remove build condition above to allow -race -short, after Wasm VM fix - package wasmer import ( @@ -21,6 +17,10 @@ import ( var ownerAddressBytes = []byte("12345678901234567890123456789012") func TestAllowNonFloatingPointSC(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + wasmvm, scAddress := deploy(t, "../testdata/floating_point/non_fp.wasm") defer closeVM(wasmvm) @@ -37,6 +37,10 @@ func TestAllowNonFloatingPointSC(t *testing.T) { } func TestDisallowFloatingPointSC(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + wasmvm, scAddress := deploy(t, "../testdata/floating_point/fp.wasm") defer closeVM(wasmvm) @@ -53,6 +57,10 @@ func TestDisallowFloatingPointSC(t *testing.T) { } func TestSCAbortExecution_DontAbort(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + wasmvm, scAddress := deploy(t, "../testdata/misc/test_abort/test_abort.wasm") defer closeVM(wasmvm) @@ -74,6 +82,10 @@ func TestSCAbortExecution_DontAbort(t *testing.T) { } func TestSCAbortExecution_Abort(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + wasmvm, scAddress := deploy(t, "../testdata/misc/test_abort/test_abort.wasm") defer closeVM(wasmvm) diff --git a/integrationTests/vm/wasm/wasmvm/executeViaBlockchainhook_test.go b/integrationTests/vm/wasm/wasmvm/executeViaBlockchainhook_test.go index e36c4bb744d..9d12746bff5 100644 --- a/integrationTests/vm/wasm/wasmvm/executeViaBlockchainhook_test.go +++ b/integrationTests/vm/wasm/wasmvm/executeViaBlockchainhook_test.go @@ -1,5 +1,3 @@ -//go:build !race - package wasmvm import ( @@ -17,6 +15,9 @@ import ( ) func TestExecuteOnDestCtx_BlockchainHook(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } net := integrationTests.NewTestNetworkSized(t, 1, 1, 1) net.Start() diff --git a/integrationTests/vm/wasm/wasmvm/gasSchedule_test.go b/integrationTests/vm/wasm/wasmvm/gasSchedule_test.go index 496a31c0c06..735fbdc2ac3 100644 --- a/integrationTests/vm/wasm/wasmvm/gasSchedule_test.go +++ b/integrationTests/vm/wasm/wasmvm/gasSchedule_test.go @@ -1,7 +1,3 @@ -//go:build !race - -// TODO remove build condition above to allow -race -short, after Wasm VM fix - package wasmvm import ( @@ -17,22 +13,37 @@ import ( ) func Benchmark_VmDeployWithFibbonacciAndExecute(b *testing.B) { + if testing.Short() { + b.Skip("this is not a short benchmark") + } + runWASMVMBenchmark(b, "../testdata/misc/fib_wasm/output/fib_wasm.wasm", 32, "_main", nil, b.N, nil) } func Benchmark_searchingForPanic(b *testing.B) { + if testing.Short() { + b.Skip("this is not a short benchmark") + } for i := 0; i < 10; i++ { runWASMVMBenchmark(b, "../testdata/misc/fib_wasm/output/fib_wasm.wasm", 100, "_main", nil, b.N, nil) } } func Test_searchingForPanic(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + for i := 0; i < 10; i++ { runWASMVMBenchmark(t, "../testdata/misc/fib_wasm/output/fib_wasm.wasm", 100, "_main", nil, 1, nil) } } func Benchmark_VmDeployWithBadContractAndExecute(b *testing.B) { + if testing.Short() { + b.Skip("this is not a short benchmark") + } + gasSchedule, _ := common.LoadGasScheduleConfig("../../../../cmd/node/config/gasSchedules/gasScheduleV4.toml") result, err := RunTest("../testdata/misc/bad.wasm", 0, "bigLoop", nil, b.N, gasSchedule, 1500000000) @@ -47,6 +58,10 @@ func Benchmark_VmDeployWithBadContractAndExecute(b *testing.B) { } func Benchmark_VmDeployWithBadContractAndExecute2(b *testing.B) { + if testing.Short() { + b.Skip("this is not a short benchmark") + } + gasSchedule, _ := common.LoadGasScheduleConfig("../../../../cmd/node/config/gasSchedules/gasScheduleV4.toml") arg, _ := hex.DecodeString("012c") @@ -62,100 +77,196 @@ func Benchmark_VmDeployWithBadContractAndExecute2(b *testing.B) { } func Benchmark_VmDeployWithCPUCalculateAndExecute(b *testing.B) { + if testing.Short() { + b.Skip("this is not a short benchmark") + } + runWASMVMBenchmark(b, "../testdata/misc/cpucalculate_wasm/output/cpucalculate.wasm", 8000, "cpuCalculate", nil, b.N, nil) } func Benchmark_VmDeployWithStringConcatAndExecute(b *testing.B) { + if testing.Short() { + b.Skip("this is not a short benchmark") + } + runWASMVMBenchmark(b, "../testdata/misc/stringconcat_wasm/stringconcat_wasm.wasm", 10000, "_main", nil, b.N, nil) } func Benchmark_TestStore100(b *testing.B) { + if testing.Short() { + b.Skip("this is not a short benchmark") + } + runWASMVMBenchmark(b, "../testdata/storage100/output/storage100.wasm", 0, "store100", nil, b.N, nil) } func Benchmark_TestStorageBigIntNew(b *testing.B) { + if testing.Short() { + b.Skip("this is not a short benchmark") + } + runWASMVMBenchmark(b, "../testdata/c-api-tests/bigInt/output/cApiTest.wasm", 0, "bigIntNewTest", nil, b.N, nil) } func Benchmark_TestBigIntGetUnSignedBytes(b *testing.B) { + if testing.Short() { + b.Skip("this is not a short benchmark") + } + runWASMVMBenchmark(b, "../testdata/c-api-tests/bigInt/output/cApiTest.wasm", 0, "bigIntGetUnsignedBytesTest", nil, b.N, nil) } func Benchmark_TestBigIntAdd(b *testing.B) { + if testing.Short() { + b.Skip("this is not a short benchmark") + } + runWASMVMBenchmark(b, "../testdata/c-api-tests/bigInt/output/cApiTest.wasm", 0, "bigIntAddTest", nil, b.N, nil) } func Benchmark_TestBigIntMul(b *testing.B) { + if testing.Short() { + b.Skip("this is not a short benchmark") + } + runWASMVMBenchmark(b, "../testdata/c-api-tests/bigInt/output/cApiTest.wasm", 0, "bigIntMulTest", nil, b.N, nil) } func Benchmark_TestBigIntMul25(b *testing.B) { + if testing.Short() { + b.Skip("this is not a short benchmark") + } + runWASMVMBenchmark(b, "../testdata/c-api-tests/bigInt/output/cApiTest.wasm", 0, "bigIntMul25Test", nil, b.N, nil) } func Benchmark_TestBigIntMul32(b *testing.B) { + if testing.Short() { + b.Skip("this is not a short benchmark") + } + runWASMVMBenchmark(b, "../testdata/c-api-tests/bigInt/output/cApiTest.wasm", 0, "bigIntMul32Test", nil, b.N, nil) } func Benchmark_TestBigIntTDiv(b *testing.B) { + if testing.Short() { + b.Skip("this is not a short benchmark") + } + runWASMVMBenchmark(b, "../testdata/c-api-tests/bigInt/output/cApiTest.wasm", 0, "bigIntTDivTest", nil, b.N, nil) } func Benchmark_TestBigIntTMod(b *testing.B) { + if testing.Short() { + b.Skip("this is not a short benchmark") + } + runWASMVMBenchmark(b, "../testdata/c-api-tests/bigInt/output/cApiTest.wasm", 0, "bigIntTModTest", nil, b.N, nil) } func Benchmark_TestBigIntEDiv(b *testing.B) { + if testing.Short() { + b.Skip("this is not a short benchmark") + } + runWASMVMBenchmark(b, "../testdata/c-api-tests/bigInt/output/cApiTest.wasm", 0, "bigIntEDivTest", nil, b.N, nil) } func Benchmark_TestBigIntEMod(b *testing.B) { + if testing.Short() { + b.Skip("this is not a short benchmark") + } + runWASMVMBenchmark(b, "../testdata/c-api-tests/bigInt/output/cApiTest.wasm", 0, "bigIntEModTest", nil, b.N, nil) } func Benchmark_TestBigIntShr(b *testing.B) { + if testing.Short() { + b.Skip("this is not a short benchmark") + } + runWASMVMBenchmark(b, "../testdata/c-api-tests/bigInt/output/cApiTest.wasm", 0, "bigIntShrTest", nil, b.N, nil) } func Benchmark_TestBigIntSetup(b *testing.B) { + if testing.Short() { + b.Skip("this is not a short benchmark") + } + runWASMVMBenchmark(b, "../testdata/c-api-tests/bigInt/output/cApiTest.wasm", 0, "bigIntInitSetup", nil, b.N, nil) } func Benchmark_TestCryptoSHA256(b *testing.B) { + if testing.Short() { + b.Skip("this is not a short benchmark") + } + runWASMVMBenchmark(b, "../testdata/c-api-tests/crypto/output/cryptoTest.wasm", 0, "sha256Test", nil, b.N, nil) } func Benchmark_TestCryptoKeccak256(b *testing.B) { + if testing.Short() { + b.Skip("this is not a short benchmark") + } + runWASMVMBenchmark(b, "../testdata/c-api-tests/crypto/output/cryptoTest.wasm", 0, "keccak256Test", nil, b.N, nil) } func Benchmark_TestCryptoRipMed160(b *testing.B) { + if testing.Short() { + b.Skip("this is not a short benchmark") + } + runWASMVMBenchmark(b, "../testdata/c-api-tests/crypto/output/cryptoTest.wasm", 0, "ripemd160Test", nil, b.N, nil) } func Benchmark_TestCryptoBLS(b *testing.B) { + if testing.Short() { + b.Skip("this is not a short benchmark") + } + runWASMVMBenchmark(b, "../testdata/c-api-tests/crypto/output/cryptoTest.wasm", 0, "verifyBLSTest", nil, b.N, nil) } func Benchmark_TestCryptoVerifyED25519(b *testing.B) { + if testing.Short() { + b.Skip("this is not a short benchmark") + } + runWASMVMBenchmark(b, "../testdata/c-api-tests/crypto/output/cryptoTest.wasm", 0, "verifyEd25519Test", nil, b.N, nil) } func Benchmark_TestCryptoSecp256k1UnCompressed(b *testing.B) { + if testing.Short() { + b.Skip("this is not a short benchmark") + } + runWASMVMBenchmark(b, "../testdata/c-api-tests/crypto/output/cryptoTest.wasm", 0, "verifySecp256k1UncompressedKeyTest", nil, b.N, nil) } func Benchmark_TestCryptoSecp256k1Compressed(b *testing.B) { + if testing.Short() { + b.Skip("this is not a short benchmark") + } + runWASMVMBenchmark(b, "../testdata/c-api-tests/crypto/output/cryptoTest.wasm", 0, "verifySecp256k1CompressedKeyTest", nil, b.N, nil) } func Benchmark_TestEllipticCurveInitialVariablesAndCalls(b *testing.B) { + if testing.Short() { + b.Skip("this is not a short benchmark") + } + runWASMVMBenchmark(b, "../testdata/c-api-tests/ecBenchmark/output/ecBenchmark.wasm", 0, "initialVariablesAndCallsTest", nil, b.N, nil) } // elliptic curves func Benchmark_TestEllipticCurve(b *testing.B) { + if testing.Short() { + b.Skip("this is not a short benchmark") + } + testEllipticCurve(b, "p224Add") testEllipticCurve(b, "p256Add") testEllipticCurve(b, "p384Add") @@ -191,21 +302,37 @@ func Benchmark_TestEllipticCurve(b *testing.B) { } func Benchmark_TestEllipticCurveScalarMultP224(b *testing.B) { + if testing.Short() { + b.Skip("this is not a short benchmark") + } + gasSchedule, _ := common.LoadGasScheduleConfig(integrationTests.GasSchedulePath) runWASMVMBenchmark(b, "../testdata/c-api-tests/ecBenchmark/output/ecBenchmark.wasm", 0, "p224ScalarMultEcTest", getNumberOfRepsAndScalarLengthArgs(10), b.N, gasSchedule) } func Benchmark_TestEllipticCurveScalarMultP256(b *testing.B) { + if testing.Short() { + b.Skip("this is not a short benchmark") + } + gasSchedule, _ := common.LoadGasScheduleConfig(integrationTests.GasSchedulePath) runWASMVMBenchmark(b, "../testdata/c-api-tests/ecBenchmark/output/ecBenchmark.wasm", 0, "p256ScalarMultEcTest", getNumberOfRepsAndScalarLengthArgs(10), b.N, gasSchedule) } func Benchmark_TestEllipticCurveScalarMultP384(b *testing.B) { + if testing.Short() { + b.Skip("this is not a short benchmark") + } + gasSchedule, _ := common.LoadGasScheduleConfig(integrationTests.GasSchedulePath) runWASMVMBenchmark(b, "../testdata/c-api-tests/ecBenchmark/output/ecBenchmark.wasm", 0, "p384ScalarMultEcTest", getNumberOfRepsAndScalarLengthArgs(10), b.N, gasSchedule) } func Benchmark_TestEllipticCurveScalarMultP521(b *testing.B) { + if testing.Short() { + b.Skip("this is not a short benchmark") + } + gasSchedule, _ := common.LoadGasScheduleConfig(integrationTests.GasSchedulePath) runWASMVMBenchmark(b, "../testdata/c-api-tests/ecBenchmark/output/ecBenchmark.wasm", 0, "p521ScalarMultEcTest", getNumberOfRepsAndScalarLengthArgs(10), b.N, gasSchedule) } @@ -216,10 +343,18 @@ func testEllipticCurve(b *testing.B, function string) { } func Benchmark_TestCryptoDoNothing(b *testing.B) { + if testing.Short() { + b.Skip("this is not a short benchmark") + } + runWASMVMBenchmark(b, "../testdata/c-api-tests/crypto/output/cryptoTest.wasm", 0, "doNothing", nil, b.N, nil) } func Benchmark_TestStorageRust(b *testing.B) { + if testing.Short() { + b.Skip("this is not a short benchmark") + } + gasSchedule, _ := common.LoadGasScheduleConfig(integrationTests.GasSchedulePath) buff := make([]byte, 100) _, _ = rand.Read(buff) @@ -228,6 +363,10 @@ func Benchmark_TestStorageRust(b *testing.B) { } func TestGasModel(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + gasSchedule, _ := common.LoadGasScheduleConfig(integrationTests.GasSchedulePath) totalOp := uint64(0) diff --git a/integrationTests/vm/wasm/wasmvm/versionswitch/vm_test.go b/integrationTests/vm/wasm/wasmvm/versionswitch/vm_test.go index 45565934c77..e69b329162e 100644 --- a/integrationTests/vm/wasm/wasmvm/versionswitch/vm_test.go +++ b/integrationTests/vm/wasm/wasmvm/versionswitch/vm_test.go @@ -1,7 +1,3 @@ -//go:build !race - -// TODO remove build condition above to allow -race -short, after Wasm VM fix - package versionswitch import ( diff --git a/integrationTests/vm/wasm/wasmvm/versionswitch_revert/vm_test.go b/integrationTests/vm/wasm/wasmvm/versionswitch_revert/vm_test.go index dac92a24a75..9563bc24615 100644 --- a/integrationTests/vm/wasm/wasmvm/versionswitch_revert/vm_test.go +++ b/integrationTests/vm/wasm/wasmvm/versionswitch_revert/vm_test.go @@ -1,7 +1,3 @@ -//go:build !race - -// TODO remove build condition above to allow -race -short, after Wasm VM fix - package versionswitch_revert import ( diff --git a/integrationTests/vm/wasm/wasmvm/versionswitch_vmquery/vm_test.go b/integrationTests/vm/wasm/wasmvm/versionswitch_vmquery/vm_test.go index 4af3688e4fa..52cf2ccb190 100644 --- a/integrationTests/vm/wasm/wasmvm/versionswitch_vmquery/vm_test.go +++ b/integrationTests/vm/wasm/wasmvm/versionswitch_vmquery/vm_test.go @@ -1,7 +1,3 @@ -//go:build !race - -// TODO remove build condition above to allow -race -short, after Wasm VM fix - package versionswitch_vmquery import ( diff --git a/integrationTests/vm/wasm/wasmvm/wasmVM_test.go b/integrationTests/vm/wasm/wasmvm/wasmVM_test.go index 9df0d4e22b5..53ace932675 100644 --- a/integrationTests/vm/wasm/wasmvm/wasmVM_test.go +++ b/integrationTests/vm/wasm/wasmvm/wasmVM_test.go @@ -1,7 +1,3 @@ -//go:build !race - -// TODO remove build condition above to allow -race -short, after Wasm VM fix - package wasmvm import ( @@ -46,6 +42,10 @@ import ( var log = logger.GetOrCreate("wasmVMtest") func TestVmDeployWithTransferAndGasShouldDeploySCCode(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + senderAddressBytes := []byte("12345678901234567890123456789012") senderNonce := uint64(0) senderBalance := big.NewInt(100000000) @@ -92,6 +92,10 @@ func TestVmDeployWithTransferAndGasShouldDeploySCCode(t *testing.T) { } func TestVmSCDeployFactory(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + senderAddressBytes := []byte("12345678901234567890123456789012") senderNonce := uint64(0) senderBalance := big.NewInt(100000000) @@ -148,6 +152,10 @@ func TestVmSCDeployFactory(t *testing.T) { } func TestSCMoveBalanceBeforeSCDeployV1(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + ownerAddressBytes := []byte("12345678901234567890123456789012") ownerNonce := uint64(0) ownerBalance := big.NewInt(100000000) @@ -228,6 +236,10 @@ func TestSCMoveBalanceBeforeSCDeployV1(t *testing.T) { } func TestSCMoveBalanceBeforeSCDeploy(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + ownerAddressBytes := []byte("12345678901234567890123456789012") ownerNonce := uint64(0) ownerBalance := big.NewInt(100000000) @@ -307,6 +319,10 @@ func TestSCMoveBalanceBeforeSCDeploy(t *testing.T) { } func TestWASMMetering(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + ownerAddressBytes := []byte("12345678901234567890123456789012") ownerNonce := uint64(11) ownerBalance := big.NewInt(0xfffffffffffffff) @@ -408,6 +424,7 @@ func TestMultipleTimesERC20RustBigIntInBatches(t *testing.T) { if testing.Short() { t.Skip("this is not a short test") } + gasSchedule, _ := common.LoadGasScheduleConfig(integrationTests.GasSchedulePath) durations, err := DeployAndExecuteERC20WithBigInt(3, 1000, gasSchedule, "../testdata/erc20-c-03/rust-simple-erc20.wasm", "transfer") require.Nil(t, err) @@ -446,6 +463,10 @@ func displayBenchmarksResults(durations []time.Duration) { } func TestDeployERC20WithNotEnoughGasShouldReturnOutOfGas(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + gasSchedule, _ := common.LoadGasScheduleConfig(integrationTests.GasSchedulePath) ownerAddressBytes := []byte("12345678901234567890123456789011") ownerNonce := uint64(11) @@ -480,8 +501,7 @@ func TestDeployERC20WithNotEnoughGasShouldReturnOutOfGas(t *testing.T) { } func TestJournalizingAndTimeToProcessChange(t *testing.T) { - // Only a test to benchmark jurnalizing and getting data from trie - t.Skip() + t.Skip("Only a test to benchmark jurnalizing and getting data from trie") numRun := 1000 ownerAddressBytes := []byte("12345678901234567890123456789011") @@ -577,8 +597,7 @@ func TestJournalizingAndTimeToProcessChange(t *testing.T) { } func TestExecuteTransactionAndTimeToProcessChange(t *testing.T) { - // Only a test to benchmark transaction processing - t.Skip() + t.Skip("Only a test to benchmark transaction processing") testMarshalizer := &marshal.JsonMarshalizer{} testHasher := sha256.NewSha256() @@ -817,6 +836,10 @@ func TestAndCatchTrieError(t *testing.T) { } func TestCommunityContract_InShard(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + zero := big.NewInt(0) transferEGLD := big.NewInt(42) @@ -859,6 +882,10 @@ func TestCommunityContract_InShard(t *testing.T) { } func TestCommunityContract_CrossShard(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + zero := big.NewInt(0) transferEGLD := big.NewInt(42) @@ -904,6 +931,10 @@ func TestCommunityContract_CrossShard(t *testing.T) { } func TestCommunityContract_CrossShard_TxProcessor(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + // Scenario: // 1. Deploy FunderSC on shard 0, owned by funderOwner // 2. Deploy ParentSC on shard 1, owned by parentOwner; deployment needs address of FunderSC @@ -1018,6 +1049,10 @@ func TestCommunityContract_CrossShard_TxProcessor(t *testing.T) { } func TestDeployDNSV2SetDeleteUserNames(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + senderAddressBytes, _ := vm.TestAddressPubkeyConverter.Decode(vm.DNSV2DeployerAddress) senderNonce := uint64(0) senderBalance := big.NewInt(100000000) diff --git a/node/nodeRunner_test.go b/node/nodeRunner_test.go index bb20b16fc47..5d0e9a7666c 100644 --- a/node/nodeRunner_test.go +++ b/node/nodeRunner_test.go @@ -1,5 +1,3 @@ -//go:build !race - package node import ( @@ -22,7 +20,9 @@ import ( const originalConfigsPath = "../cmd/node/config" func TestNewNodeRunner(t *testing.T) { - t.Parallel() + if testing.Short() { + t.Skip("this is not a short test") + } t.Run("nil configs should error", func(t *testing.T) { t.Parallel() @@ -45,7 +45,9 @@ func TestNewNodeRunner(t *testing.T) { } func TestNodeRunner_StartAndCloseNodeUsingSIGINT(t *testing.T) { - t.Parallel() + if testing.Short() { + t.Skip("this is not a short test") + } configs, err := testscommon.CreateTestConfigs(t.TempDir(), originalConfigsPath) require.Nil(t, err) @@ -76,7 +78,9 @@ func TestNodeRunner_StartAndCloseNodeUsingSIGINT(t *testing.T) { } func TestCopyDirectory(t *testing.T) { - t.Parallel() + if testing.Short() { + t.Skip("this is not a short test") + } file1Name := "file1.toml" file1Contents := []byte("file1") @@ -134,7 +138,9 @@ func TestCopyDirectory(t *testing.T) { } func TestWaitForSignal(t *testing.T) { - t.Parallel() + if testing.Short() { + t.Skip("this is not a short test") + } closedCalled := make(map[string]struct{}) healthServiceClosableComponent := &mock.CloserStub{ From 0f84d9890bfaf365d5554379a78d4a345e02930f Mon Sep 17 00:00:00 2001 From: Iulian Pascalau Date: Thu, 14 Mar 2024 16:57:31 +0200 Subject: [PATCH 2/2] - more skipped tests --- factory/status/statusComponents_test.go | 9 ++--- genesis/process/genesisBlockCreator_test.go | 2 -- integrationTests/api/transaction_test.go | 4 +++ .../benchmarks/loadFromTrie_test.go | 4 +++ .../staking/simpleStake_test.go | 4 +++ .../dataComponents/dataComponents_test.go | 4 +++ .../frontend/wallet/txInterception_test.go | 12 +++++++ .../node/getAccount/getAccount_test.go | 8 +++-- .../networkSharding_test.go | 8 ++--- .../singleShard/smartContract/dns_test.go | 3 +- .../state/genesisState/genesisState_test.go | 8 +++-- .../stateExecTransaction_test.go | 5 +-- .../state/stateTrieSync/stateTrieSync_test.go | 8 +++++ .../vm/mockVM/vmDeploy/vmDeploy_test.go | 16 +++++++++ .../vm/mockVM/vmGet/vmGet_test.go | 4 +++ .../vmRunContract/vmRunContract_test.go | 16 +++++++++ integrationTests/vm/staking/stakingV4_test.go | 36 ++++++++++++++----- .../vm/txsFee/apiTransactionEvaluator_test.go | 12 +++---- .../vm/txsFee/backwardsCompatibility_test.go | 12 +++++++ .../vm/txsFee/builtInFunctions_test.go | 32 +++++++++++++++++ .../vm/txsFee/esdtLocalBurn_test.go | 12 +++++++ .../vm/txsFee/esdtLocalMint_test.go | 8 +++++ integrationTests/vm/txsFee/esdt_test.go | 16 +++++++++ .../vm/txsFee/moveBalance_test.go | 28 +++++++++++++++ .../vm/txsFee/multiESDTTransfer_test.go | 8 +++++ .../asyncCallWithChangeOwner_test.go | 2 +- .../multiShard/builtInFunctions_test.go | 2 +- .../txsFee/multiShard/esdtLiquidity_test.go | 12 +++++++ .../vm/txsFee/multiShard/esdt_test.go | 8 +++++ .../vm/txsFee/multiShard/moveBalance_test.go | 16 +++++++-- .../multiShard/nftTransferUpdate_test.go | 4 +++ .../relayedBuiltInFunctions_test.go | 3 +- .../multiShard/relayedMoveBalance_test.go | 24 +++++++++++++ .../vm/txsFee/relayedMoveBalance_test.go | 28 +++++++++++++++ .../vm/txsFee/validatorSC_test.go | 20 +++++++++++ .../vm/wasm/badcontracts/badcontracts_test.go | 20 +++++++++++ .../vm/wasm/wasmvm/asyncMockContracts_test.go | 11 ++++-- .../vm/wasm/wasmvm/deployment/deploy_test.go | 2 +- .../vm/wasm/wasmvm/deployment/upgrade_test.go | 2 +- .../adder/converterAdder_test.go | 8 +++++ .../converterEllipticCurves_test.go | 8 +++++ .../scenariosTests/mex/converterMex_test.go | 8 +++++ .../components/processComponents_test.go | 21 +++-------- .../components/testOnlyProcessingNode_test.go | 23 ++++++------ .../factory/shard/vmContainerFactory_test.go | 8 ++--- 45 files changed, 429 insertions(+), 80 deletions(-) diff --git a/factory/status/statusComponents_test.go b/factory/status/statusComponents_test.go index 3e1c0f8ba53..2b7c3e59379 100644 --- a/factory/status/statusComponents_test.go +++ b/factory/status/statusComponents_test.go @@ -2,7 +2,6 @@ package status_test import ( "errors" - "runtime" "testing" "github.com/multiversx/mx-chain-communication-go/websocket/data" @@ -136,7 +135,9 @@ func TestNewStatusComponentsFactory(t *testing.T) { } func TestStatusComponentsFactory_Create(t *testing.T) { - // no t.Parallel for these tests as they create real components + if testing.Short() { + t.Skip("this is not a short test") + } t.Run("NewSoftwareVersionFactory fails should return error", func(t *testing.T) { args := createMockStatusComponentsFactoryArgs() @@ -188,10 +189,6 @@ func TestStatusComponentsFactory_Create(t *testing.T) { require.Nil(t, sc) }) t.Run("should work", func(t *testing.T) { - if runtime.GOOS == "darwin" && runtime.GOARCH == "amd64" { - t.Skip("skipping test on darwin amd64") - } - shardCoordinator := mock.NewMultiShardsCoordinatorMock(2) shardCoordinator.SelfIDCalled = func() uint32 { return core.MetachainShardId // coverage diff --git a/genesis/process/genesisBlockCreator_test.go b/genesis/process/genesisBlockCreator_test.go index 2ccea85ef14..68c93b87f51 100644 --- a/genesis/process/genesisBlockCreator_test.go +++ b/genesis/process/genesisBlockCreator_test.go @@ -1,7 +1,5 @@ //go:build !race -// TODO reinstate test after Wasm VM pointer fix - package process import ( diff --git a/integrationTests/api/transaction_test.go b/integrationTests/api/transaction_test.go index c4267676343..2ecb27b850c 100644 --- a/integrationTests/api/transaction_test.go +++ b/integrationTests/api/transaction_test.go @@ -14,6 +14,10 @@ import ( ) func TestTransactionGroup(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + node := integrationTests.NewTestProcessorNodeWithTestWebServer(3, 0, 0) testTransactionGasCostWithMissingFields(t, node) diff --git a/integrationTests/benchmarks/loadFromTrie_test.go b/integrationTests/benchmarks/loadFromTrie_test.go index c3c7a99f573..576326bbc0d 100644 --- a/integrationTests/benchmarks/loadFromTrie_test.go +++ b/integrationTests/benchmarks/loadFromTrie_test.go @@ -32,6 +32,10 @@ func TestTrieLoadTime(t *testing.T) { } func TestTrieLoadTimeForOneLevel(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + numTrieLevels := 1 numTries := 10000 numChildrenPerBranch := 8 diff --git a/integrationTests/chainSimulator/staking/simpleStake_test.go b/integrationTests/chainSimulator/staking/simpleStake_test.go index 6439e14d623..735a0bde4b2 100644 --- a/integrationTests/chainSimulator/staking/simpleStake_test.go +++ b/integrationTests/chainSimulator/staking/simpleStake_test.go @@ -28,6 +28,10 @@ import ( // // Internal test scenario #3 func TestChainSimulator_SimpleStake(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + t.Run("staking ph 4 is not active", func(t *testing.T) { testChainSimulatorSimpleStake(t, 1, "queued") }) diff --git a/integrationTests/factory/dataComponents/dataComponents_test.go b/integrationTests/factory/dataComponents/dataComponents_test.go index 9ebc4a49fc5..c28a41c6543 100644 --- a/integrationTests/factory/dataComponents/dataComponents_test.go +++ b/integrationTests/factory/dataComponents/dataComponents_test.go @@ -13,6 +13,10 @@ import ( ) func TestDataComponents_Create_Close_ShouldWork(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + time.Sleep(time.Second * 4) gc := goroutines.NewGoCounter(goroutines.TestsRelevantGoRoutines) diff --git a/integrationTests/frontend/wallet/txInterception_test.go b/integrationTests/frontend/wallet/txInterception_test.go index 1cb60ea8a46..1eeacc61f94 100644 --- a/integrationTests/frontend/wallet/txInterception_test.go +++ b/integrationTests/frontend/wallet/txInterception_test.go @@ -15,6 +15,10 @@ import ( const mintingValue = "100000000" func TestInterceptedTxWithoutDataField(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + value := big.NewInt(0) value.SetString("999", 10) @@ -35,6 +39,10 @@ func TestInterceptedTxWithoutDataField(t *testing.T) { } func TestInterceptedTxWithDataField(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + value := big.NewInt(0) value.SetString("999", 10) @@ -55,6 +63,10 @@ func TestInterceptedTxWithDataField(t *testing.T) { } func TestInterceptedTxWithSigningOverTxHash(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + value := big.NewInt(0) value.SetString("1000000000000000000", 10) diff --git a/integrationTests/node/getAccount/getAccount_test.go b/integrationTests/node/getAccount/getAccount_test.go index 16fa37909c3..487c8b1a15a 100644 --- a/integrationTests/node/getAccount/getAccount_test.go +++ b/integrationTests/node/getAccount/getAccount_test.go @@ -31,7 +31,9 @@ func createAccountsRepository(accDB state.AccountsAdapter, blockchain chainData. } func TestNode_GetAccountAccountDoesNotExistsShouldRetEmpty(t *testing.T) { - t.Parallel() + if testing.Short() { + t.Skip("this is not a short test") + } trieStorage, _ := integrationTests.CreateTrieStorageManager(testscommon.CreateMemUnit()) accDB, _ := integrationTests.CreateAccountsDB(0, trieStorage) @@ -67,7 +69,9 @@ func TestNode_GetAccountAccountDoesNotExistsShouldRetEmpty(t *testing.T) { } func TestNode_GetAccountAccountExistsShouldReturn(t *testing.T) { - t.Parallel() + if testing.Short() { + t.Skip("this is not a short test") + } testNonce := uint64(7) testBalance := big.NewInt(100) diff --git a/integrationTests/p2p/networkSharding-hbv2/networkSharding_test.go b/integrationTests/p2p/networkSharding-hbv2/networkSharding_test.go index c11c73838c5..94f26831173 100644 --- a/integrationTests/p2p/networkSharding-hbv2/networkSharding_test.go +++ b/integrationTests/p2p/networkSharding-hbv2/networkSharding_test.go @@ -39,6 +39,10 @@ func createDefaultConfig() p2pConfig.P2PConfig { } func TestConnectionsInNetworkShardingWithShardingWithLists(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + p2pCfg := createDefaultConfig() p2pCfg.Sharding = p2pConfig.ShardingConfig{ TargetPeerCount: 12, @@ -54,10 +58,6 @@ func TestConnectionsInNetworkShardingWithShardingWithLists(t *testing.T) { } func testConnectionsInNetworkSharding(t *testing.T, p2pConfig p2pConfig.P2PConfig) { - if testing.Short() { - t.Skip("this is not a short test") - } - nodesPerShard := 8 numMetaNodes := 8 numObserversOnShard := 2 diff --git a/integrationTests/singleShard/smartContract/dns_test.go b/integrationTests/singleShard/smartContract/dns_test.go index 94319e2ef7a..bdfd26da827 100644 --- a/integrationTests/singleShard/smartContract/dns_test.go +++ b/integrationTests/singleShard/smartContract/dns_test.go @@ -13,9 +13,8 @@ import ( ) func TestDNS_Register(t *testing.T) { - // TODO reinstate test after Wasm VM pointer fix if testing.Short() { - t.Skip("cannot run with -race -short; requires Wasm VM fix") + t.Skip("this is not a short test") } expectedDNSAddress := []byte{0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 180, 108, 178, 102, 195, 67, 184, 127, 204, 159, 104, 123, 190, 33, 224, 91, 255, 244, 118, 95, 24, 217} diff --git a/integrationTests/state/genesisState/genesisState_test.go b/integrationTests/state/genesisState/genesisState_test.go index 306980f2ce6..811ae1a4901 100644 --- a/integrationTests/state/genesisState/genesisState_test.go +++ b/integrationTests/state/genesisState/genesisState_test.go @@ -70,7 +70,9 @@ func TestCreationOfTheGenesisState(t *testing.T) { } func TestExtensionNodeToBranchEdgeCaseSet1(t *testing.T) { - t.Parallel() + if testing.Short() { + t.Skip("this is not a short test") + } tr1 := integrationTests.CreateNewDefaultTrie() tr2 := integrationTests.CreateNewDefaultTrie() @@ -105,7 +107,9 @@ func TestExtensionNodeToBranchEdgeCaseSet1(t *testing.T) { } func TestExtensionNodeToBranchEdgeCaseSet2(t *testing.T) { - t.Parallel() + if testing.Short() { + t.Skip("this is not a short test") + } tr1 := integrationTests.CreateNewDefaultTrie() tr2 := integrationTests.CreateNewDefaultTrie() diff --git a/integrationTests/state/stateExecTransaction/stateExecTransaction_test.go b/integrationTests/state/stateExecTransaction/stateExecTransaction_test.go index c97b9ad52b6..f79e0ff22cc 100644 --- a/integrationTests/state/stateExecTransaction/stateExecTransaction_test.go +++ b/integrationTests/state/stateExecTransaction/stateExecTransaction_test.go @@ -52,7 +52,9 @@ func TestExecTransaction_SelfTransactionShouldWork(t *testing.T) { } func TestExecTransaction_SelfTransactionWithRevertShouldWork(t *testing.T) { - t.Parallel() + if testing.Short() { + t.Skip("this is not a short test") + } trieStorage, _ := integrationTests.CreateTrieStorageManager(integrationTests.CreateMemUnit()) accnts, _ := integrationTests.CreateAccountsDB(0, trieStorage) @@ -182,7 +184,6 @@ func TestExecTransaction_MoreTransactionsMoreIterationsWithRevertShouldWork(t *t if testing.Short() { t.Skip("this is not a short test") } - t.Parallel() trieStorage, _ := integrationTests.CreateTrieStorageManager(integrationTests.CreateMemUnit()) accnts, _ := integrationTests.CreateAccountsDB(0, trieStorage) diff --git a/integrationTests/state/stateTrieSync/stateTrieSync_test.go b/integrationTests/state/stateTrieSync/stateTrieSync_test.go index 8bfbd584a70..4833c99f4fe 100644 --- a/integrationTests/state/stateTrieSync/stateTrieSync_test.go +++ b/integrationTests/state/stateTrieSync/stateTrieSync_test.go @@ -59,6 +59,10 @@ func createTestProcessorNodeAndTrieStorage( } func TestNode_RequestInterceptTrieNodesWithMessenger(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + t.Run("test with double lists version", func(t *testing.T) { testNodeRequestInterceptTrieNodesWithMessenger(t, 2) }) @@ -180,6 +184,10 @@ func printStatistics(ctx context.Context, stats common.SizeSyncStatisticsHandler } func TestNode_RequestInterceptTrieNodesWithMessengerNotSyncingShouldErr(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + t.Run("test with double lists version", func(t *testing.T) { testNodeRequestInterceptTrieNodesWithMessengerNotSyncingShouldErr(t, 2) }) diff --git a/integrationTests/vm/mockVM/vmDeploy/vmDeploy_test.go b/integrationTests/vm/mockVM/vmDeploy/vmDeploy_test.go index 4390a3eff47..1a53d3ce4e9 100644 --- a/integrationTests/vm/mockVM/vmDeploy/vmDeploy_test.go +++ b/integrationTests/vm/mockVM/vmDeploy/vmDeploy_test.go @@ -15,6 +15,10 @@ import ( ) func TestVmDeployWithoutTransferShouldDeploySCCode(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + vmOpGas := uint64(1) senderAddressBytes := []byte("12345678901234567890123456789012") senderNonce := uint64(11) @@ -70,6 +74,10 @@ func TestVmDeployWithoutTransferShouldDeploySCCode(t *testing.T) { } func TestVmDeployWithTransferShouldDeploySCCode(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + vmOpGas := uint64(1) senderAddressBytes := []byte("12345678901234567890123456789012") senderNonce := uint64(11) @@ -124,6 +132,10 @@ func TestVmDeployWithTransferShouldDeploySCCode(t *testing.T) { } func TestVmDeployWithTransferAndGasShouldDeploySCCode(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + vmOpGas := uint64(1) senderAddressBytes := []byte("12345678901234567890123456789012") senderNonce := uint64(11) @@ -181,6 +193,10 @@ func TestVmDeployWithTransferAndGasShouldDeploySCCode(t *testing.T) { } func TestVMDeployWithTransferWithInsufficientGasShouldReturnErr(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + vmOpGas := uint64(1000) senderAddressBytes := []byte("12345678901234567890123456789012") senderNonce := uint64(11) diff --git a/integrationTests/vm/mockVM/vmGet/vmGet_test.go b/integrationTests/vm/mockVM/vmGet/vmGet_test.go index bd818df6884..5083c44a276 100644 --- a/integrationTests/vm/mockVM/vmGet/vmGet_test.go +++ b/integrationTests/vm/mockVM/vmGet/vmGet_test.go @@ -29,6 +29,10 @@ import ( ) func TestVmGetShouldReturnValue(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + accnts, destinationAddressBytes, expectedValueForVar := deploySmartContract(t) mockVM := vm.CreateOneSCExecutorMockVM(accnts) diff --git a/integrationTests/vm/mockVM/vmRunContract/vmRunContract_test.go b/integrationTests/vm/mockVM/vmRunContract/vmRunContract_test.go index 00f8ef20610..af7d0e33e47 100644 --- a/integrationTests/vm/mockVM/vmRunContract/vmRunContract_test.go +++ b/integrationTests/vm/mockVM/vmRunContract/vmRunContract_test.go @@ -19,6 +19,10 @@ import ( // TODO add integration and unit tests with generating and broadcasting transaction with empty recv address func TestRunSCWithoutTransferShouldRunSCCode(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + vmOpGas := uint64(1) senderAddressBytes := []byte("12345678901234567890123456789012") senderNonce := uint64(11) @@ -89,6 +93,10 @@ func TestRunSCWithoutTransferShouldRunSCCode(t *testing.T) { } func TestRunSCWithTransferShouldRunSCCode(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + vmOpGas := uint64(1) senderAddressBytes := []byte("12345678901234567890123456789012") senderNonce := uint64(11) @@ -160,6 +168,10 @@ func TestRunSCWithTransferShouldRunSCCode(t *testing.T) { } func TestRunWithTransferAndGasShouldRunSCCode(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + vmOpGas := uint64(1) senderAddressBytes := []byte("12345678901234567890123456789012") senderNonce := uint64(11) @@ -231,6 +243,10 @@ func TestRunWithTransferAndGasShouldRunSCCode(t *testing.T) { } func TestRunWithTransferWithInsufficientGasShouldReturnErr(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + vmOpGas := uint64(1) senderAddressBytes := []byte("12345678901234567890123456789012") senderNonce := uint64(11) diff --git a/integrationTests/vm/staking/stakingV4_test.go b/integrationTests/vm/staking/stakingV4_test.go index 45cc1bcd85e..6471ec72d3e 100644 --- a/integrationTests/vm/staking/stakingV4_test.go +++ b/integrationTests/vm/staking/stakingV4_test.go @@ -175,7 +175,9 @@ func checkStakingV4EpochChangeFlow( } func TestStakingV4(t *testing.T) { - t.Parallel() + if testing.Short() { + t.Skip("this is not a short test") + } numOfMetaNodes := uint32(400) numOfShards := uint32(3) @@ -271,7 +273,9 @@ func TestStakingV4(t *testing.T) { } func TestStakingV4MetaProcessor_ProcessMultipleNodesWithSameSetupExpectSameRootHash(t *testing.T) { - t.Parallel() + if testing.Short() { + t.Skip("this is not a short test") + } numOfMetaNodes := uint32(6) numOfShards := uint32(3) @@ -318,7 +322,9 @@ func TestStakingV4MetaProcessor_ProcessMultipleNodesWithSameSetupExpectSameRootH } func TestStakingV4_UnStakeNodesWithNotEnoughFunds(t *testing.T) { - t.Parallel() + if testing.Short() { + t.Skip("this is not a short test") + } pubKeys := generateAddresses(0, 20) @@ -476,7 +482,9 @@ func TestStakingV4_UnStakeNodesWithNotEnoughFunds(t *testing.T) { } func TestStakingV4_StakeNewNodes(t *testing.T) { - t.Parallel() + if testing.Short() { + t.Skip("this is not a short test") + } pubKeys := generateAddresses(0, 20) @@ -617,7 +625,9 @@ func TestStakingV4_StakeNewNodes(t *testing.T) { } func TestStakingV4_UnStakeNodes(t *testing.T) { - t.Parallel() + if testing.Short() { + t.Skip("this is not a short test") + } pubKeys := generateAddresses(0, 20) @@ -812,7 +822,9 @@ func TestStakingV4_UnStakeNodes(t *testing.T) { } func TestStakingV4_JailAndUnJailNodes(t *testing.T) { - t.Parallel() + if testing.Short() { + t.Skip("this is not a short test") + } pubKeys := generateAddresses(0, 20) @@ -969,7 +981,9 @@ func TestStakingV4_JailAndUnJailNodes(t *testing.T) { } func TestStakingV4_DifferentEdgeCasesWithNotEnoughNodesInWaitingShouldSendShuffledToToWaiting(t *testing.T) { - t.Parallel() + if testing.Short() { + t.Skip("this is not a short test") + } pubKeys := generateAddresses(0, 20) @@ -1184,7 +1198,9 @@ func TestStakingV4_DifferentEdgeCasesWithNotEnoughNodesInWaitingShouldSendShuffl } func TestStakingV4_NewlyStakedNodesInStakingV4Step2ShouldBeSentToWaitingIfListIsTooLow(t *testing.T) { - t.Parallel() + if testing.Short() { + t.Skip("this is not a short test") + } pubKeys := generateAddresses(0, 20) @@ -1323,7 +1339,9 @@ func TestStakingV4_NewlyStakedNodesInStakingV4Step2ShouldBeSentToWaitingIfListIs } func TestStakingV4_LeavingNodesEdgeCases(t *testing.T) { - t.Parallel() + if testing.Short() { + t.Skip("this is not a short test") + } pubKeys := generateAddresses(0, 20) diff --git a/integrationTests/vm/txsFee/apiTransactionEvaluator_test.go b/integrationTests/vm/txsFee/apiTransactionEvaluator_test.go index e5b6661d02e..6c3f6844403 100644 --- a/integrationTests/vm/txsFee/apiTransactionEvaluator_test.go +++ b/integrationTests/vm/txsFee/apiTransactionEvaluator_test.go @@ -27,7 +27,7 @@ func getZeroGasAndFees() scheduled.GasAndFees { func TestSCCallCostTransactionCost(t *testing.T) { if testing.Short() { - t.Skip("cannot run with -race -short; requires Wasm VM fix") + t.Skip("this is not a short test") } testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{ @@ -54,7 +54,7 @@ func TestSCCallCostTransactionCost(t *testing.T) { func TestScDeployTransactionCost(t *testing.T) { if testing.Short() { - t.Skip("cannot run with -race -short; requires Wasm VM fix") + t.Skip("this is not a short test") } testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) @@ -74,7 +74,7 @@ func TestScDeployTransactionCost(t *testing.T) { func TestAsyncCallsTransactionCost(t *testing.T) { if testing.Short() { - t.Skip("cannot run with -race -short; requires Wasm VM fix") + t.Skip("this is not a short test") } testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) @@ -105,7 +105,7 @@ func TestAsyncCallsTransactionCost(t *testing.T) { func TestBuiltInFunctionTransactionCost(t *testing.T) { if testing.Short() { - t.Skip("cannot run with -race -short; requires Wasm VM fix") + t.Skip("this is not a short test") } testContext, err := vm.CreatePreparedTxProcessorWithVMs( @@ -131,7 +131,7 @@ func TestBuiltInFunctionTransactionCost(t *testing.T) { func TestESDTTransfer(t *testing.T) { if testing.Short() { - t.Skip("cannot run with -race -short; requires Wasm VM fix") + t.Skip("this is not a short test") } testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) @@ -154,7 +154,7 @@ func TestESDTTransfer(t *testing.T) { func TestAsyncESDTTransfer(t *testing.T) { if testing.Short() { - t.Skip("cannot run with -race -short; requires Wasm VM fix") + t.Skip("this is not a short test") } testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{ diff --git a/integrationTests/vm/txsFee/backwardsCompatibility_test.go b/integrationTests/vm/txsFee/backwardsCompatibility_test.go index 94735de21a5..2b160d342cd 100644 --- a/integrationTests/vm/txsFee/backwardsCompatibility_test.go +++ b/integrationTests/vm/txsFee/backwardsCompatibility_test.go @@ -17,6 +17,10 @@ import ( // minGasPrice = 1, gasPerDataByte = 1, minGasLimit = 1 func TestMoveBalanceSelfShouldWorkAndConsumeTxFeeWhenAllFlagsAreDisabled(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{ PenalizedTooMuchGasEnableEpoch: 100, SCDeployEnableEpoch: 100, @@ -57,6 +61,10 @@ func TestMoveBalanceSelfShouldWorkAndConsumeTxFeeWhenAllFlagsAreDisabled(t *test // minGasPrice = 1, gasPerDataByte = 1, minGasLimit = 1 func TestMoveBalanceAllFlagsDisabledLessBalanceThanGasLimitMulGasPrice(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{ PenalizedTooMuchGasEnableEpoch: integrationTests.UnreachableEpoch, BuiltInFunctionsEnableEpoch: integrationTests.UnreachableEpoch, @@ -80,6 +88,10 @@ func TestMoveBalanceAllFlagsDisabledLessBalanceThanGasLimitMulGasPrice(t *testin } func TestMoveBalanceSelfShouldWorkAndConsumeTxFeeWhenSomeFlagsAreDisabled(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs( config.EnableEpochs{ PenalizedTooMuchGasEnableEpoch: 0, diff --git a/integrationTests/vm/txsFee/builtInFunctions_test.go b/integrationTests/vm/txsFee/builtInFunctions_test.go index 8bd8c80db0f..5f0ae16ebc3 100644 --- a/integrationTests/vm/txsFee/builtInFunctions_test.go +++ b/integrationTests/vm/txsFee/builtInFunctions_test.go @@ -66,6 +66,10 @@ func TestBuildInFunctionChangeOwnerCallShouldWorkV1(t *testing.T) { } func TestBuildInFunctionChangeOwnerCallShouldWork(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs( config.EnableEpochs{ PenalizedTooMuchGasEnableEpoch: integrationTests.UnreachableEpoch, @@ -103,6 +107,10 @@ func TestBuildInFunctionChangeOwnerCallShouldWork(t *testing.T) { } func TestBuildInFunctionChangeOwnerCallWrongOwnerShouldConsumeGas(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -140,6 +148,10 @@ func TestBuildInFunctionChangeOwnerCallWrongOwnerShouldConsumeGas(t *testing.T) } func TestBuildInFunctionChangeOwnerInvalidAddressShouldConsumeGas(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -174,6 +186,10 @@ func TestBuildInFunctionChangeOwnerInvalidAddressShouldConsumeGas(t *testing.T) } func TestBuildInFunctionChangeOwnerCallInsufficientGasLimitShouldNotConsumeGas(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -210,6 +226,10 @@ func TestBuildInFunctionChangeOwnerCallInsufficientGasLimitShouldNotConsumeGas(t } func TestBuildInFunctionChangeOwnerOutOfGasShouldConsumeGas(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -245,6 +265,10 @@ func TestBuildInFunctionChangeOwnerOutOfGasShouldConsumeGas(t *testing.T) { } func TestBuildInFunctionSaveKeyValue_WrongDestination(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + shardCoord, _ := sharding.NewMultiShardCoordinator(2, 0) testContext, err := vm.CreatePreparedTxProcessorWithVMsWithShardCoordinator( @@ -280,6 +304,10 @@ func TestBuildInFunctionSaveKeyValue_WrongDestination(t *testing.T) { } func TestBuildInFunctionSaveKeyValue_NotEnoughGasFor3rdSave(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + shardCoord, _ := sharding.NewMultiShardCoordinator(2, 0) testContext, err := vm.CreatePreparedTxProcessorWithVMsWithShardCoordinator( @@ -308,6 +336,10 @@ func TestBuildInFunctionSaveKeyValue_NotEnoughGasFor3rdSave(t *testing.T) { } func TestBuildInFunctionSaveKeyValue_NotEnoughGasForTheSameKeyValue(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + shardCoord, _ := sharding.NewMultiShardCoordinator(2, 0) gasScheduleNotifier := vm.CreateMockGasScheduleNotifier() diff --git a/integrationTests/vm/txsFee/esdtLocalBurn_test.go b/integrationTests/vm/txsFee/esdtLocalBurn_test.go index c76957928a5..29c4fc26320 100644 --- a/integrationTests/vm/txsFee/esdtLocalBurn_test.go +++ b/integrationTests/vm/txsFee/esdtLocalBurn_test.go @@ -14,6 +14,10 @@ import ( ) func TestESDTLocalBurnShouldWork(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -44,6 +48,10 @@ func TestESDTLocalBurnShouldWork(t *testing.T) { } func TestESDTLocalBurnMoreThanTotalBalanceShouldErr(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -74,6 +82,10 @@ func TestESDTLocalBurnMoreThanTotalBalanceShouldErr(t *testing.T) { } func TestESDTLocalBurnNotAllowedShouldErr(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() diff --git a/integrationTests/vm/txsFee/esdtLocalMint_test.go b/integrationTests/vm/txsFee/esdtLocalMint_test.go index 491d9102372..f2104f4c341 100644 --- a/integrationTests/vm/txsFee/esdtLocalMint_test.go +++ b/integrationTests/vm/txsFee/esdtLocalMint_test.go @@ -14,6 +14,10 @@ import ( ) func TestESDTLocalMintShouldWork(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -44,6 +48,10 @@ func TestESDTLocalMintShouldWork(t *testing.T) { } func TestESDTLocalMintNotAllowedShouldErr(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() diff --git a/integrationTests/vm/txsFee/esdt_test.go b/integrationTests/vm/txsFee/esdt_test.go index da865619d4e..07871a87750 100644 --- a/integrationTests/vm/txsFee/esdt_test.go +++ b/integrationTests/vm/txsFee/esdt_test.go @@ -18,6 +18,10 @@ import ( ) func TestESDTTransferShouldWork(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -54,6 +58,10 @@ func TestESDTTransferShouldWork(t *testing.T) { } func TestESDTTransferShouldWorkToMuchGasShouldConsumeAllGas(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -90,6 +98,10 @@ func TestESDTTransferShouldWorkToMuchGasShouldConsumeAllGas(t *testing.T) { } func TestESDTTransferInvalidESDTValueShouldConsumeGas(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -126,6 +138,10 @@ func TestESDTTransferInvalidESDTValueShouldConsumeGas(t *testing.T) { } func TestESDTTransferCallBackOnErrorShouldNotGenerateSCRsFurther(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + shardC, _ := sharding.NewMultiShardCoordinator(2, 0) testContext, err := vm.CreatePreparedTxProcessorWithVMsWithShardCoordinator(config.EnableEpochs{}, shardC) require.Nil(t, err) diff --git a/integrationTests/vm/txsFee/moveBalance_test.go b/integrationTests/vm/txsFee/moveBalance_test.go index 78646813825..848494b0396 100644 --- a/integrationTests/vm/txsFee/moveBalance_test.go +++ b/integrationTests/vm/txsFee/moveBalance_test.go @@ -20,6 +20,10 @@ const gasPrice = uint64(10) // minGasPrice = 1, gasPerDataByte = 1, minGasLimit = 1 func TestMoveBalanceSelfShouldWorkAndConsumeTxFee(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -55,6 +59,10 @@ func TestMoveBalanceSelfShouldWorkAndConsumeTxFee(t *testing.T) { // minGasPrice = 1, gasPerDataByte = 1, minGasLimit = 1 func TestMoveBalanceAllFlagsEnabledLessBalanceThanGasLimitMulGasPrice(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -72,6 +80,10 @@ func TestMoveBalanceAllFlagsEnabledLessBalanceThanGasLimitMulGasPrice(t *testing } func TestMoveBalanceShouldWork(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -112,6 +124,10 @@ func TestMoveBalanceShouldWork(t *testing.T) { } func TestMoveBalanceInvalidHasGasButNoValueShouldConsumeGas(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -141,6 +157,10 @@ func TestMoveBalanceInvalidHasGasButNoValueShouldConsumeGas(t *testing.T) { } func TestMoveBalanceHigherNonceShouldNotConsumeGas(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -171,6 +191,10 @@ func TestMoveBalanceHigherNonceShouldNotConsumeGas(t *testing.T) { } func TestMoveBalanceMoreGasThanGasLimitPerMiniBlockForSafeCrossShard(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -202,6 +226,10 @@ func TestMoveBalanceMoreGasThanGasLimitPerMiniBlockForSafeCrossShard(t *testing. } func TestMoveBalanceInvalidUserNames(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() diff --git a/integrationTests/vm/txsFee/multiESDTTransfer_test.go b/integrationTests/vm/txsFee/multiESDTTransfer_test.go index d9457da31c5..c85a1a2bc1b 100644 --- a/integrationTests/vm/txsFee/multiESDTTransfer_test.go +++ b/integrationTests/vm/txsFee/multiESDTTransfer_test.go @@ -15,6 +15,10 @@ import ( ) func TestMultiESDTTransferShouldWork(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -69,6 +73,10 @@ func TestMultiESDTTransferShouldWork(t *testing.T) { } func TestMultiESDTTransferFailsBecauseOfMaxLimit(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMsAndCustomGasSchedule(config.EnableEpochs{}, func(gasMap wasmConfig.GasScheduleMap) { gasMap[common.MaxPerTransaction]["MaxNumberOfTransfersPerTx"] = 1 diff --git a/integrationTests/vm/txsFee/multiShard/asyncCallWithChangeOwner_test.go b/integrationTests/vm/txsFee/multiShard/asyncCallWithChangeOwner_test.go index aac3723f294..28130046e11 100644 --- a/integrationTests/vm/txsFee/multiShard/asyncCallWithChangeOwner_test.go +++ b/integrationTests/vm/txsFee/multiShard/asyncCallWithChangeOwner_test.go @@ -17,7 +17,7 @@ import ( func TestDoChangeOwnerCrossShardFromAContract(t *testing.T) { if testing.Short() { - t.Skip("cannot run with -race -short; requires Wasm VM fix") + t.Skip("this is not a short test") } enableEpochs := config.EnableEpochs{ diff --git a/integrationTests/vm/txsFee/multiShard/builtInFunctions_test.go b/integrationTests/vm/txsFee/multiShard/builtInFunctions_test.go index ea14882730b..dc6172eeef8 100644 --- a/integrationTests/vm/txsFee/multiShard/builtInFunctions_test.go +++ b/integrationTests/vm/txsFee/multiShard/builtInFunctions_test.go @@ -33,7 +33,7 @@ func getZeroGasAndFees() scheduled.GasAndFees { // 4. Execute SCR from context destination on context source ( the new owner will receive the developer rewards) func TestBuiltInFunctionExecuteOnSourceAndDestinationShouldWork(t *testing.T) { if testing.Short() { - t.Skip("cannot run with -race -short; requires Wasm VM fix") + t.Skip("this is not a short test") } testContextSource, err := vm.CreatePreparedTxProcessorWithVMsMultiShard( diff --git a/integrationTests/vm/txsFee/multiShard/esdtLiquidity_test.go b/integrationTests/vm/txsFee/multiShard/esdtLiquidity_test.go index a18a62003e3..036c17d9cef 100644 --- a/integrationTests/vm/txsFee/multiShard/esdtLiquidity_test.go +++ b/integrationTests/vm/txsFee/multiShard/esdtLiquidity_test.go @@ -18,6 +18,10 @@ import ( ) func TestSystemAccountLiquidityAfterCrossShardTransferAndBurn(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + tokenID := []byte("MYNFT") sh0Addr := []byte("12345678901234567890123456789010") sh1Addr := []byte("12345678901234567890123456789011") @@ -66,6 +70,10 @@ func TestSystemAccountLiquidityAfterCrossShardTransferAndBurn(t *testing.T) { } func TestSystemAccountLiquidityAfterNFTWipe(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + tokenID := []byte("MYNFT-0a0a0a") sh0Addr := bytes.Repeat([]byte{1}, 31) sh0Addr = append(sh0Addr, 0) @@ -112,6 +120,10 @@ func TestSystemAccountLiquidityAfterNFTWipe(t *testing.T) { } func TestSystemAccountLiquidityAfterSFTWipe(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + tokenID := []byte("MYSFT-0a0a0a") sh0Addr := bytes.Repeat([]byte{1}, 31) sh0Addr = append(sh0Addr, 0) diff --git a/integrationTests/vm/txsFee/multiShard/esdt_test.go b/integrationTests/vm/txsFee/multiShard/esdt_test.go index f224b528ef6..8f978daee1c 100644 --- a/integrationTests/vm/txsFee/multiShard/esdt_test.go +++ b/integrationTests/vm/txsFee/multiShard/esdt_test.go @@ -16,6 +16,10 @@ import ( ) func TestESDTTransferShouldWork(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMsMultiShard(1, config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -46,6 +50,10 @@ func TestESDTTransferShouldWork(t *testing.T) { } func TestMultiESDTNFTTransferViaRelayedV2(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + tokenID1 := []byte("MYNFT1") tokenID2 := []byte("MYNFT2") sh0Addr := []byte("12345678901234567890123456789010") diff --git a/integrationTests/vm/txsFee/multiShard/moveBalance_test.go b/integrationTests/vm/txsFee/multiShard/moveBalance_test.go index 41e404d4af7..8c5f6bd6015 100644 --- a/integrationTests/vm/txsFee/multiShard/moveBalance_test.go +++ b/integrationTests/vm/txsFee/multiShard/moveBalance_test.go @@ -14,6 +14,10 @@ import ( ) func TestMoveBalanceShouldWork(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMsMultiShard(1, config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -49,7 +53,9 @@ func TestMoveBalanceShouldWork(t *testing.T) { } func TestMoveBalanceContractAddressDataFieldNilShouldConsumeGas(t *testing.T) { - t.Parallel() + if testing.Short() { + t.Skip("this is not a short test") + } testContext, err := vm.CreatePreparedTxProcessorWithVMsMultiShard(1, config.EnableEpochs{}) require.Nil(t, err) @@ -89,7 +95,9 @@ func TestMoveBalanceContractAddressDataFieldNilShouldConsumeGas(t *testing.T) { } func TestMoveBalanceContractAddressDataFieldNotNilShouldConsumeGas(t *testing.T) { - t.Parallel() + if testing.Short() { + t.Skip("this is not a short test") + } testContext, err := vm.CreatePreparedTxProcessorWithVMsMultiShard(1, config.EnableEpochs{}) require.Nil(t, err) @@ -129,6 +137,10 @@ func TestMoveBalanceContractAddressDataFieldNotNilShouldConsumeGas(t *testing.T) } func TestMoveBalanceExecuteOneSourceAndDestinationShard(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContextSource, err := vm.CreatePreparedTxProcessorWithVMsMultiShard(0, config.EnableEpochs{}) require.Nil(t, err) defer testContextSource.Close() diff --git a/integrationTests/vm/txsFee/multiShard/nftTransferUpdate_test.go b/integrationTests/vm/txsFee/multiShard/nftTransferUpdate_test.go index 3a0b19b0b24..1fdd2f6f78f 100644 --- a/integrationTests/vm/txsFee/multiShard/nftTransferUpdate_test.go +++ b/integrationTests/vm/txsFee/multiShard/nftTransferUpdate_test.go @@ -15,6 +15,10 @@ import ( ) func TestNFTTransferAndUpdateOnOldTypeToken(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + enableEpochs := config.EnableEpochs{ CheckCorrectTokenIDForTransferRoleEnableEpoch: 3, DisableExecByCallerEnableEpoch: 3, diff --git a/integrationTests/vm/txsFee/multiShard/relayedBuiltInFunctions_test.go b/integrationTests/vm/txsFee/multiShard/relayedBuiltInFunctions_test.go index a97a5bfd7fe..e987d4dbc74 100644 --- a/integrationTests/vm/txsFee/multiShard/relayedBuiltInFunctions_test.go +++ b/integrationTests/vm/txsFee/multiShard/relayedBuiltInFunctions_test.go @@ -15,9 +15,8 @@ import ( ) func TestRelayedBuiltInFunctionExecuteOnRelayerAndDstShardShouldWork(t *testing.T) { - // TODO reinstate test after Wasm VM pointer fix if testing.Short() { - t.Skip("cannot run with -race -short; requires Wasm VM fix") + t.Skip("this is not a short test") } testContextRelayer, err := vm.CreatePreparedTxProcessorWithVMsMultiShard( diff --git a/integrationTests/vm/txsFee/multiShard/relayedMoveBalance_test.go b/integrationTests/vm/txsFee/multiShard/relayedMoveBalance_test.go index 2dd36161143..aa206c591b4 100644 --- a/integrationTests/vm/txsFee/multiShard/relayedMoveBalance_test.go +++ b/integrationTests/vm/txsFee/multiShard/relayedMoveBalance_test.go @@ -14,6 +14,10 @@ import ( ) func TestRelayedMoveBalanceRelayerShard0InnerTxSenderAndReceiverShard1ShouldWork(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMsMultiShard(1, config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -58,6 +62,10 @@ func TestRelayedMoveBalanceRelayerShard0InnerTxSenderAndReceiverShard1ShouldWork } func TestRelayedMoveBalanceRelayerAndInnerTxSenderShard0ReceiverShard1(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMsMultiShard(1, config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -103,6 +111,10 @@ func TestRelayedMoveBalanceRelayerAndInnerTxSenderShard0ReceiverShard1(t *testin } func TestRelayedMoveBalanceExecuteOnSourceAndDestination(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContextSource, err := vm.CreatePreparedTxProcessorWithVMsMultiShard(0, config.EnableEpochs{}) require.Nil(t, err) defer testContextSource.Close() @@ -167,6 +179,10 @@ func TestRelayedMoveBalanceExecuteOnSourceAndDestination(t *testing.T) { } func TestRelayedMoveBalanceExecuteOnSourceAndDestinationRelayerAndInnerTxSenderShard0InnerTxReceiverShard1ShouldWork(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContextSource, err := vm.CreatePreparedTxProcessorWithVMsMultiShard(0, config.EnableEpochs{}) require.Nil(t, err) defer testContextSource.Close() @@ -227,6 +243,10 @@ func TestRelayedMoveBalanceExecuteOnSourceAndDestinationRelayerAndInnerTxSenderS } func TestRelayedMoveBalanceRelayerAndInnerTxReceiverShard0SenderShard1(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContextSource, err := vm.CreatePreparedTxProcessorWithVMsMultiShard(0, config.EnableEpochs{}) require.Nil(t, err) defer testContextSource.Close() @@ -299,6 +319,10 @@ func TestRelayedMoveBalanceRelayerAndInnerTxReceiverShard0SenderShard1(t *testin } func TestMoveBalanceRelayerShard0InnerTxSenderShard1InnerTxReceiverShard2ShouldWork(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContextRelayer, err := vm.CreatePreparedTxProcessorWithVMsMultiShard(0, config.EnableEpochs{}) require.Nil(t, err) defer testContextRelayer.Close() diff --git a/integrationTests/vm/txsFee/relayedMoveBalance_test.go b/integrationTests/vm/txsFee/relayedMoveBalance_test.go index 2c7e230941d..accdffbfb4e 100644 --- a/integrationTests/vm/txsFee/relayedMoveBalance_test.go +++ b/integrationTests/vm/txsFee/relayedMoveBalance_test.go @@ -19,6 +19,10 @@ import ( ) func TestRelayedMoveBalanceShouldWork(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -65,6 +69,10 @@ func TestRelayedMoveBalanceShouldWork(t *testing.T) { } func TestRelayedMoveBalanceInvalidGasLimitShouldConsumeGas(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -97,6 +105,10 @@ func TestRelayedMoveBalanceInvalidGasLimitShouldConsumeGas(t *testing.T) { } func TestRelayedMoveBalanceInvalidUserTxShouldConsumeGas(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{}) require.Nil(t, err) defer testContext.Close() @@ -129,6 +141,10 @@ func TestRelayedMoveBalanceInvalidUserTxShouldConsumeGas(t *testing.T) { } func TestRelayedMoveBalanceInvalidUserTxValueShouldConsumeGas(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{ RelayedNonceFixEnableEpoch: 1, }) @@ -163,6 +179,10 @@ func TestRelayedMoveBalanceInvalidUserTxValueShouldConsumeGas(t *testing.T) { } func TestRelayedMoveBalanceHigherNonce(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{ RelayedNonceFixEnableEpoch: 1, }) @@ -215,6 +235,10 @@ func TestRelayedMoveBalanceHigherNonce(t *testing.T) { } func TestRelayedMoveBalanceLowerNonce(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{ RelayedNonceFixEnableEpoch: 1, }) @@ -267,6 +291,10 @@ func TestRelayedMoveBalanceLowerNonce(t *testing.T) { } func TestRelayedMoveBalanceHigherNonceWithActivatedFixCrossShard(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + enableEpochs := config.EnableEpochs{ RelayedNonceFixEnableEpoch: 0, } diff --git a/integrationTests/vm/txsFee/validatorSC_test.go b/integrationTests/vm/txsFee/validatorSC_test.go index ca4ff9271de..6de545c5c93 100644 --- a/integrationTests/vm/txsFee/validatorSC_test.go +++ b/integrationTests/vm/txsFee/validatorSC_test.go @@ -50,6 +50,10 @@ func saveDelegationManagerConfig(testContext *vm.VMTestContext) { } func TestValidatorsSC_DoStakePutInQueueUnStakeAndUnBondShouldRefund(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContextMeta, err := vm.CreatePreparedTxProcessorWithVMsMultiShard(core.MetachainShardId, config.EnableEpochs{}) require.Nil(t, err) @@ -106,6 +110,10 @@ func checkReturnLog(t *testing.T, testContextMeta *vm.VMTestContext, subStr stri } func TestValidatorsSC_DoStakePutInQueueUnStakeAndUnBondTokensShouldRefund(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContextMeta, err := vm.CreatePreparedTxProcessorWithVMsMultiShard( core.MetachainShardId, config.EnableEpochs{ @@ -142,6 +150,10 @@ func TestValidatorsSC_DoStakePutInQueueUnStakeAndUnBondTokensShouldRefund(t *tes } func TestValidatorsSC_DoStakeWithTopUpValueTryToUnStakeTokensAndUnBondTokens(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + argUnbondTokensV1 := config.EnableEpochs{ UnbondTokensV2EnableEpoch: 20000, StakingV4Step1EnableEpoch: stakingV4Step1EnableEpoch, @@ -185,6 +197,10 @@ func testValidatorsSCDoStakeWithTopUpValueTryToUnStakeTokensAndUnBondTokens(t *t } func TestValidatorsSC_ToStakePutInQueueUnStakeAndUnBondShouldRefundUnBondTokens(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContextMeta, err := vm.CreatePreparedTxProcessorWithVMsMultiShard( core.MetachainShardId, config.EnableEpochs{ @@ -237,6 +253,10 @@ func TestValidatorsSC_ToStakePutInQueueUnStakeAndUnBondShouldRefundUnBondTokens( } func TestValidatorsSC_ToStakePutInQueueUnStakeNodesAndUnBondNodesShouldRefund(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testContextMeta, err := vm.CreatePreparedTxProcessorWithVMsMultiShard( core.MetachainShardId, config.EnableEpochs{ diff --git a/integrationTests/vm/wasm/badcontracts/badcontracts_test.go b/integrationTests/vm/wasm/badcontracts/badcontracts_test.go index ccf211853b8..3ccd475e739 100644 --- a/integrationTests/vm/wasm/badcontracts/badcontracts_test.go +++ b/integrationTests/vm/wasm/badcontracts/badcontracts_test.go @@ -50,6 +50,10 @@ func Test_Bad_C_NoPanic(t *testing.T) { } func Test_Empty_C_NoPanic(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + context := wasm.SetupTestContext(t) defer context.Close() @@ -60,6 +64,10 @@ func Test_Empty_C_NoPanic(t *testing.T) { } func Test_Corrupt_NoPanic(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + context := wasm.SetupTestContext(t) defer context.Close() @@ -70,6 +78,10 @@ func Test_Corrupt_NoPanic(t *testing.T) { } func Test_NoMemoryDeclaration_NoPanic(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + context := wasm.SetupTestContext(t) defer context.Close() @@ -80,6 +92,10 @@ func Test_NoMemoryDeclaration_NoPanic(t *testing.T) { } func Test_BadFunctionNames_NoPanic(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + context := wasm.SetupTestContext(t) defer context.Close() @@ -88,6 +104,10 @@ func Test_BadFunctionNames_NoPanic(t *testing.T) { } func Test_BadReservedFunctions(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + context := wasm.SetupTestContext(t) defer context.Close() diff --git a/integrationTests/vm/wasm/wasmvm/asyncMockContracts_test.go b/integrationTests/vm/wasm/wasmvm/asyncMockContracts_test.go index 393ef51f5de..f7a3eece169 100644 --- a/integrationTests/vm/wasm/wasmvm/asyncMockContracts_test.go +++ b/integrationTests/vm/wasm/wasmvm/asyncMockContracts_test.go @@ -59,17 +59,22 @@ func TestMockContract_AsyncLegacy_InShard(t *testing.T) { } func TestMockContract_AsyncLegacy_CrossShard(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testMockContract_CrossShard(t, LegacyAsyncCallType) } func TestMockContract_NewAsync_CrossShard(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + testMockContract_CrossShard(t, NewAsyncCallType) } func testMockContract_CrossShard(t *testing.T, asyncCallType []byte) { - if testing.Short() { - t.Skip("this is not a short test") - } transferEGLD := big.NewInt(42) numberOfShards := 2 diff --git a/integrationTests/vm/wasm/wasmvm/deployment/deploy_test.go b/integrationTests/vm/wasm/wasmvm/deployment/deploy_test.go index a4cfb755b76..a57599d2866 100644 --- a/integrationTests/vm/wasm/wasmvm/deployment/deploy_test.go +++ b/integrationTests/vm/wasm/wasmvm/deployment/deploy_test.go @@ -22,7 +22,7 @@ var senderBalance = big.NewInt(1000000000000) func TestScDeployShouldManageCorrectlyTheCodeMetadata(t *testing.T) { if testing.Short() { - t.Skip("cannot run with -race -short; requires Wasm VM fix") + t.Skip("this is not a short test") } testContext, err := vm.CreatePreparedTxProcessorAndAccountsWithVMs( diff --git a/integrationTests/vm/wasm/wasmvm/deployment/upgrade_test.go b/integrationTests/vm/wasm/wasmvm/deployment/upgrade_test.go index 6d52f68acf2..22d2fc48a3f 100644 --- a/integrationTests/vm/wasm/wasmvm/deployment/upgrade_test.go +++ b/integrationTests/vm/wasm/wasmvm/deployment/upgrade_test.go @@ -20,7 +20,7 @@ const gasLimit = uint64(10000000) func TestScUpgradeShouldManageCorrectlyTheCodeMetadata(t *testing.T) { if testing.Short() { - t.Skip("cannot run with -race -short; requires Wasm VM fix") + t.Skip("this is not a short test") } testContext, err := vm.CreatePreparedTxProcessorAndAccountsWithVMs( diff --git a/integrationTests/vm/wasm/wasmvm/scenariosConverter/scenariosTests/adder/converterAdder_test.go b/integrationTests/vm/wasm/wasmvm/scenariosConverter/scenariosTests/adder/converterAdder_test.go index b5d99257277..bf0fc2436fa 100644 --- a/integrationTests/vm/wasm/wasmvm/scenariosConverter/scenariosTests/adder/converterAdder_test.go +++ b/integrationTests/vm/wasm/wasmvm/scenariosConverter/scenariosTests/adder/converterAdder_test.go @@ -7,9 +7,17 @@ import ( ) func TestScenariosConverter_AdderWithExternalSteps(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + mc.CheckConverter(t, "./adder_with_external_steps.scen.json") } func Benchmark_ScenariosConverter_AdderWithExternalSteps(b *testing.B) { + if testing.Short() { + b.Skip("this is not a short benchmark") + } + mc.BenchmarkScenariosSpecificTx(b, "./adder_with_external_steps.scen.json") } diff --git a/integrationTests/vm/wasm/wasmvm/scenariosConverter/scenariosTests/ecBenchmarks/converterEllipticCurves_test.go b/integrationTests/vm/wasm/wasmvm/scenariosConverter/scenariosTests/ecBenchmarks/converterEllipticCurves_test.go index 1978b6c0794..1f7b260e707 100644 --- a/integrationTests/vm/wasm/wasmvm/scenariosConverter/scenariosTests/ecBenchmarks/converterEllipticCurves_test.go +++ b/integrationTests/vm/wasm/wasmvm/scenariosConverter/scenariosTests/ecBenchmarks/converterEllipticCurves_test.go @@ -7,9 +7,17 @@ import ( ) func TestScenariosConverter_EllipticCurves(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + mc.CheckConverter(t, "./elliptic_curves.scen.json") } func Benchmark_ScenariosConverter_EllipticCurves(b *testing.B) { + if testing.Short() { + b.Skip("this is not a short benchmark") + } + mc.BenchmarkScenariosSpecificTx(b, "./elliptic_curves.scen.json") } diff --git a/integrationTests/vm/wasm/wasmvm/scenariosConverter/scenariosTests/mex/converterMex_test.go b/integrationTests/vm/wasm/wasmvm/scenariosConverter/scenariosTests/mex/converterMex_test.go index bff4906aca6..c1719095a24 100644 --- a/integrationTests/vm/wasm/wasmvm/scenariosConverter/scenariosTests/mex/converterMex_test.go +++ b/integrationTests/vm/wasm/wasmvm/scenariosConverter/scenariosTests/mex/converterMex_test.go @@ -7,8 +7,16 @@ import ( ) func TestScenariosConverter_MexState(t *testing.T) { + if testing.Short() { + t.Skip("this is not a short test") + } + mc.CheckConverter(t, "./swap_fixed_input.scen.json") } func Benchmark_ScenariosConverter_SwapFixedInput(b *testing.B) { + if testing.Short() { + b.Skip("this is not a short benchmark") + } + mc.BenchmarkScenariosSpecificTx(b, "./swap_fixed_input.scen.json") } diff --git a/node/chainSimulator/components/processComponents_test.go b/node/chainSimulator/components/processComponents_test.go index 89010da5fd5..4628bbc4f66 100644 --- a/node/chainSimulator/components/processComponents_test.go +++ b/node/chainSimulator/components/processComponents_test.go @@ -236,16 +236,11 @@ func createArgsProcessComponentsHolder() ArgsProcessComponentsHolder { } func TestCreateProcessComponents(t *testing.T) { - t.Parallel() + if testing.Short() { + t.Skip("this is not a short test") + } t.Run("should work", func(t *testing.T) { - // TODO reinstate test after Wasm VM pointer fix - if testing.Short() { - t.Skip("cannot run with -race -short; requires Wasm VM fix") - } - - t.Parallel() - comp, err := CreateProcessComponents(createArgsProcessComponentsHolder()) require.NoError(t, err) require.NotNil(t, comp) @@ -351,13 +346,10 @@ func TestCreateProcessComponents(t *testing.T) { } func TestProcessComponentsHolder_IsInterfaceNil(t *testing.T) { - // TODO reinstate test after Wasm VM pointer fix if testing.Short() { - t.Skip("cannot run with -race -short; requires Wasm VM fix") + t.Skip("this is not a short test") } - t.Parallel() - var comp *processComponentsHolder require.True(t, comp.IsInterfaceNil()) @@ -367,13 +359,10 @@ func TestProcessComponentsHolder_IsInterfaceNil(t *testing.T) { } func TestProcessComponentsHolder_Getters(t *testing.T) { - // TODO reinstate test after Wasm VM pointer fix if testing.Short() { - t.Skip("cannot run with -race -short; requires Wasm VM fix") + t.Skip("this is not a short test") } - t.Parallel() - comp, err := CreateProcessComponents(createArgsProcessComponentsHolder()) require.NoError(t, err) diff --git a/node/chainSimulator/components/testOnlyProcessingNode_test.go b/node/chainSimulator/components/testOnlyProcessingNode_test.go index c48a8456086..5924663217b 100644 --- a/node/chainSimulator/components/testOnlyProcessingNode_test.go +++ b/node/chainSimulator/components/testOnlyProcessingNode_test.go @@ -3,7 +3,6 @@ package components import ( "errors" "math/big" - "runtime" "strings" "testing" "time" @@ -50,8 +49,8 @@ func createMockArgsTestOnlyProcessingNode(t *testing.T) ArgsTestOnlyProcessingNo } func TestNewTestOnlyProcessingNode(t *testing.T) { - if runtime.GOARCH == "arm64" { - t.Skip("skipping test on arm64") + if testing.Short() { + t.Skip("this is not a short test") } t.Run("should work", func(t *testing.T) { @@ -140,9 +139,8 @@ func TestNewTestOnlyProcessingNode(t *testing.T) { } func TestTestOnlyProcessingNode_SetKeyValueForAddress(t *testing.T) { - // TODO reinstate test after Wasm VM pointer fix if testing.Short() { - t.Skip("cannot run with -race -short; requires Wasm VM fix") + t.Skip("this is not a short test") } goodKeyValueMap := map[string]string{ @@ -252,9 +250,8 @@ func TestTestOnlyProcessingNode_SetKeyValueForAddress(t *testing.T) { } func TestTestOnlyProcessingNode_SetStateForAddress(t *testing.T) { - // TODO reinstate test after Wasm VM pointer fix if testing.Short() { - t.Skip("cannot run with -race -short; requires Wasm VM fix") + t.Skip("this is not a short test") } node, err := NewTestOnlyProcessingNode(createMockArgsTestOnlyProcessingNode(t)) @@ -419,8 +416,8 @@ func TestTestOnlyProcessingNode_SetStateForAddress(t *testing.T) { } func TestTestOnlyProcessingNode_IsInterfaceNil(t *testing.T) { - if runtime.GOARCH == "arm64" { - t.Skip("skipping test on arm64") + if testing.Short() { + t.Skip("this is not a short test") } var node *testOnlyProcessingNode @@ -431,8 +428,8 @@ func TestTestOnlyProcessingNode_IsInterfaceNil(t *testing.T) { } func TestTestOnlyProcessingNode_Close(t *testing.T) { - if runtime.GOARCH == "arm64" { - t.Skip("skipping test on arm64") + if testing.Short() { + t.Skip("this is not a short test") } node, err := NewTestOnlyProcessingNode(createMockArgsTestOnlyProcessingNode(t)) @@ -442,8 +439,8 @@ func TestTestOnlyProcessingNode_Close(t *testing.T) { } func TestTestOnlyProcessingNode_Getters(t *testing.T) { - if runtime.GOARCH == "arm64" { - t.Skip("skipping test on arm64") + if testing.Short() { + t.Skip("this is not a short test") } node := &testOnlyProcessingNode{} diff --git a/process/factory/shard/vmContainerFactory_test.go b/process/factory/shard/vmContainerFactory_test.go index ac0a2dd6608..a6d7184bd77 100644 --- a/process/factory/shard/vmContainerFactory_test.go +++ b/process/factory/shard/vmContainerFactory_test.go @@ -129,8 +129,6 @@ func TestNewVMContainerFactory_NilBlockChainHookShouldErr(t *testing.T) { } func TestNewVMContainerFactory_NilHasherShouldErr(t *testing.T) { - t.Parallel() - args := createMockVMAccountsArguments() args.Hasher = nil vmf, err := NewVMContainerFactory(args) @@ -140,7 +138,9 @@ func TestNewVMContainerFactory_NilHasherShouldErr(t *testing.T) { } func TestNewVMContainerFactory_OkValues(t *testing.T) { - t.Parallel() + if runtime.GOARCH == "arm64" { + t.Skip("skipping test on arm64") + } args := createMockVMAccountsArguments() vmf, err := NewVMContainerFactory(args) @@ -155,8 +155,6 @@ func TestVmContainerFactory_Create(t *testing.T) { t.Skip("skipping test on arm64") } - t.Parallel() - args := createMockVMAccountsArguments() vmf, _ := NewVMContainerFactory(args) require.NotNil(t, vmf)