diff --git a/consensus/tests/engine_v2_tests/api_test.go b/consensus/tests/engine_v2_tests/api_test.go index 2ca83c1b84..e2f419795f 100644 --- a/consensus/tests/engine_v2_tests/api_test.go +++ b/consensus/tests/engine_v2_tests/api_test.go @@ -13,6 +13,7 @@ import ( ) func TestGetMissedRoundsInEpochByBlockNumOnlyForV2Consensus(t *testing.T) { + skipLongInShortMode(t) _, bc, _, _, _ := PrepareXDCTestBlockChainWith128Candidates(t, 1802, params.TestXDPoSMockChainConfig) engine := bc.BlockChain().Engine().(*XDPoS.XDPoS) @@ -25,6 +26,7 @@ func TestGetMissedRoundsInEpochByBlockNumOnlyForV2Consensus(t *testing.T) { } func TestGetMissedRoundsInEpochByBlockNumReturnEmptyForV2(t *testing.T) { + skipLongInShortMode(t) _, bc, cb, _, _ := PrepareXDCTestBlockChainWith128Candidates(t, 1802, params.TestXDPoSMockChainConfig) engine := bc.BlockChain().Engine().(*XDPoS.XDPoS) @@ -57,6 +59,7 @@ func TestGetMissedRoundsInEpochByBlockNumReturnEmptyForV2(t *testing.T) { } func TestGetMissedRoundsInEpochByBlockNumReturnEmptyForV2FistEpoch(t *testing.T) { + skipLongInShortMode(t) _, bc, _, _, _ := PrepareXDCTestBlockChainWith128Candidates(t, 1802, params.TestXDPoSMockChainConfig) engine := bc.BlockChain().Engine().(*XDPoS.XDPoS) @@ -71,6 +74,7 @@ func TestGetMissedRoundsInEpochByBlockNumReturnEmptyForV2FistEpoch(t *testing.T) } func TestGetMissedRoundsInEpochByBlockNum(t *testing.T) { + skipLongInShortMode(t) blockchain, bc, currentBlock, signer, signFn := PrepareXDCTestBlockChainWith128Candidates(t, 1802, params.TestXDPoSMockChainConfig) chainConfig := params.TestXDPoSMockChainConfig engine := bc.BlockChain().Engine().(*XDPoS.XDPoS) @@ -112,6 +116,7 @@ func TestGetMissedRoundsInEpochByBlockNum(t *testing.T) { } func TestGetEpochNumbersBetween(t *testing.T) { + skipLongInShortMode(t) _, bc, _, _, _ := PrepareXDCTestBlockChainWith128Candidates(t, 1802, params.TestXDPoSMockChainConfig) engine := bc.BlockChain().Engine().(*XDPoS.XDPoS) @@ -169,6 +174,7 @@ func TestGetEpochNumbersBetween(t *testing.T) { assert.EqualError(t, err, "illegal begin block number 1803") } func TestGetBlockByEpochNumber(t *testing.T) { + skipLongInShortMode(t) blockchain, _, currentBlock, signer, signFn := PrepareXDCTestBlockChainWithPenaltyForV2Engine(t, 1802, params.TestXDPoSMockChainConfig) blockCoinBase := "0x111000000000000000000000000000000123" diff --git a/consensus/tests/engine_v2_tests/authorised_masternode_test.go b/consensus/tests/engine_v2_tests/authorised_masternode_test.go index 5ee7568dae..9ea21232ec 100644 --- a/consensus/tests/engine_v2_tests/authorised_masternode_test.go +++ b/consensus/tests/engine_v2_tests/authorised_masternode_test.go @@ -32,6 +32,7 @@ func TestIsAuthorisedMNForConsensusV2(t *testing.T) { } func TestIsYourTurnConsensusV2(t *testing.T) { + skipLongInShortMode(t) // we skip test for v1 since it's hard to make a real genesis block blockchain, _, currentBlock, signer, signFn, _ := PrepareXDCTestBlockChainForV2Engine(t, 900, params.TestXDPoSMockChainConfig, nil) minePeriod := params.UnitTestV2Configs[0].MinePeriod @@ -83,6 +84,7 @@ func TestIsYourTurnConsensusV2(t *testing.T) { } func TestIsYourTurnConsensusV2CrossConfig(t *testing.T) { + skipLongInShortMode(t) // we skip test for v1 since it's hard to make a real genesis block blockchain, _, currentBlock, signer, signFn, _ := PrepareXDCTestBlockChainForV2Engine(t, 909, params.TestXDPoSMockChainConfig, nil) firstMinePeriod := blockchain.Config().XDPoS.V2.CurrentConfig.MinePeriod diff --git a/consensus/tests/engine_v2_tests/helper.go b/consensus/tests/engine_v2_tests/helper.go index afa2da801c..284b3f39db 100644 --- a/consensus/tests/engine_v2_tests/helper.go +++ b/consensus/tests/engine_v2_tests/helper.go @@ -74,6 +74,13 @@ func SignHashByPK(pk *ecdsa.PrivateKey, itemToSign []byte) []byte { return signedHash } +func skipLongInShortMode(t *testing.T) { + t.Helper() + if testing.Short() { + t.Skip("skipping long-running test in -short mode") + } +} + const letterBytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" func RandStringBytes(n int) string { diff --git a/consensus/tests/engine_v2_tests/initial_test.go b/consensus/tests/engine_v2_tests/initial_test.go index 5224ae6b1c..5a34618356 100644 --- a/consensus/tests/engine_v2_tests/initial_test.go +++ b/consensus/tests/engine_v2_tests/initial_test.go @@ -13,6 +13,7 @@ import ( ) func TestInitialFirstV2Block(t *testing.T) { + skipLongInShortMode(t) blockchain, _, currentBlock, _, _, _ := PrepareXDCTestBlockChainForV2Engine(t, 900, params.TestXDPoSMockChainConfig, nil) adaptor := blockchain.Engine().(*XDPoS.XDPoS) header := currentBlock.Header() @@ -117,6 +118,7 @@ func TestInitialOtherV2Block(t *testing.T) { } func TestSnapshotShouldAlreadyCreatedByUpdateM1(t *testing.T) { + skipLongInShortMode(t) // insert new block with new extra fields blockchain, _, currentBlock, _, _, _ := PrepareXDCTestBlockChainForV2Engine(t, 1800, params.TestXDPoSMockChainConfig, nil) adaptor := blockchain.Engine().(*XDPoS.XDPoS) diff --git a/consensus/tests/engine_v2_tests/mine_test.go b/consensus/tests/engine_v2_tests/mine_test.go index 2cc06639e9..567da6418e 100644 --- a/consensus/tests/engine_v2_tests/mine_test.go +++ b/consensus/tests/engine_v2_tests/mine_test.go @@ -16,6 +16,7 @@ import ( ) func TestYourTurnInitialV2(t *testing.T) { + skipLongInShortMode(t) config := params.TestXDPoSMockChainConfig blockchain, _, parentBlock, signer, signFn, _ := PrepareXDCTestBlockChainForV2Engine(t, int(config.XDPoS.Epoch)-1, config, nil) minePeriod := config.XDPoS.V2.CurrentConfig.MinePeriod @@ -61,6 +62,7 @@ func TestYourTurnInitialV2(t *testing.T) { } func TestShouldMineOncePerRound(t *testing.T) { + skipLongInShortMode(t) config := params.TestXDPoSMockChainConfig blockchain, _, block910, signer, _, _ := PrepareXDCTestBlockChainForV2Engine(t, 910, config, nil) adaptor := blockchain.Engine().(*XDPoS.XDPoS) @@ -76,6 +78,7 @@ func TestShouldMineOncePerRound(t *testing.T) { } func TestUpdateMasterNodes(t *testing.T) { + skipLongInShortMode(t) config := params.TestXDPoSMockChainConfig blockchain, _, currentBlock, signer, signFn, _ := PrepareXDCTestBlockChainForV2Engine(t, int(config.XDPoS.Epoch+config.XDPoS.Gap)-1, config, nil) adaptor := blockchain.Engine().(*XDPoS.XDPoS) @@ -224,6 +227,7 @@ func TestPrepareHappyPath(t *testing.T) { } func TestPrepareDifferentMasternode(t *testing.T) { + skipLongInShortMode(t) config := params.TestXDPoSMockChainConfig blockchain, _, currentBlock, _, _, _ := PrepareXDCTestBlockChainForV2Engine(t, 1799, config, nil) adaptor := blockchain.Engine().(*XDPoS.XDPoS) @@ -236,6 +240,7 @@ func TestPrepareDifferentMasternode(t *testing.T) { // test if we have 128 candidates, then snapshot will store all of them, and when preparing (and verifying) candidates is truncated to MaxMasternodes func TestUpdateMultipleMasterNodes(t *testing.T) { + skipLongInShortMode(t) config := params.TestXDPoSMockChainConfig blockchain, _, currentBlock, signer, signFn := PrepareXDCTestBlockChainWith128Candidates(t, int(config.XDPoS.Epoch+config.XDPoS.Gap)-1, config) adaptor := blockchain.Engine().(*XDPoS.XDPoS) diff --git a/consensus/tests/engine_v2_tests/penalty_test.go b/consensus/tests/engine_v2_tests/penalty_test.go index dddb375cc7..7658d57d4c 100644 --- a/consensus/tests/engine_v2_tests/penalty_test.go +++ b/consensus/tests/engine_v2_tests/penalty_test.go @@ -15,6 +15,7 @@ import ( ) func TestHookPenaltyV2Mining(t *testing.T) { + skipLongInShortMode(t) config := params.TestXDPoSMockChainConfig blockchain, _, _, _, _, _ := PrepareXDCTestBlockChainForV2Engine(t, int(config.XDPoS.Epoch)*3, config, nil) adaptor := blockchain.Engine().(*XDPoS.XDPoS) @@ -67,6 +68,7 @@ func TestHookPenaltyV2Mining(t *testing.T) { } func TestHookPenaltyV2Comeback(t *testing.T) { + skipLongInShortMode(t) config := params.TestXDPoSMockChainConfig blockchain, _, _, signer, signFn := PrepareXDCTestBlockChainWithPenaltyForV2Engine(t, int(config.XDPoS.Epoch)*3, config) adaptor := blockchain.Engine().(*XDPoS.XDPoS) @@ -95,6 +97,7 @@ func TestHookPenaltyV2Comeback(t *testing.T) { } func TestHookPenaltyV2Jump(t *testing.T) { + skipLongInShortMode(t) config := params.TestXDPoSMockChainConfig end := int(config.XDPoS.Epoch)*3 - common.MergeSignRange blockchain, _, _, _, _ := PrepareXDCTestBlockChainWithPenaltyForV2Engine(t, int(config.XDPoS.Epoch)*3, config) @@ -118,6 +121,7 @@ func TestHookPenaltyV2Jump(t *testing.T) { // Test calculate penalty under startRange blocks, currently is 150 func TestHookPenaltyV2LessThen150Blocks(t *testing.T) { + skipLongInShortMode(t) config := params.TestXDPoSMockChainConfig blockchain, _, _, _, _ := PrepareXDCTestBlockChainWithPenaltyForV2Engine(t, int(config.XDPoS.Epoch)*3, config) adaptor := blockchain.Engine().(*XDPoS.XDPoS) @@ -139,6 +143,7 @@ func TestHookPenaltyV2LessThen150Blocks(t *testing.T) { } func TestGetPenalties(t *testing.T) { + skipLongInShortMode(t) config := params.TestXDPoSMockChainConfig blockchain, _, _, _, _ := PrepareXDCTestBlockChainWithPenaltyForV2Engine(t, int(config.XDPoS.Epoch)*3, config) adaptor := blockchain.Engine().(*XDPoS.XDPoS) @@ -156,6 +161,7 @@ func TestGetPenalties(t *testing.T) { // TestHookPenaltyParolee tests that a penalty stays enough epoch, it will not be penalty. // but if it does not stays enough, it will still be penalty. func TestHookPenaltyParolee(t *testing.T) { + skipLongInShortMode(t) // set upgrade number to 0 backup := common.TipUpgradePenalty common.TipUpgradePenalty = big.NewInt(0) @@ -210,6 +216,7 @@ func TestHookPenaltyParolee(t *testing.T) { // TestHookPenaltyParoleePerformance tests penalty hook performance func TestHookPenaltyParoleePerformance(t *testing.T) { + skipLongInShortMode(t) b, err := json.Marshal(params.TestXDPoSMockChainConfig) assert.Nil(t, err) configString := string(b) diff --git a/consensus/tests/engine_v2_tests/proposed_block_test.go b/consensus/tests/engine_v2_tests/proposed_block_test.go index e709ab762a..5f29b609ec 100644 --- a/consensus/tests/engine_v2_tests/proposed_block_test.go +++ b/consensus/tests/engine_v2_tests/proposed_block_test.go @@ -102,6 +102,7 @@ func TestShouldSendVoteMsgAndCommitGrandGrandParentBlock(t *testing.T) { } func TestShouldNotCommitIfRoundsNotContinousFor3Rounds(t *testing.T) { + skipLongInShortMode(t) // Block 901 is the first v2 block with round of 1 blockchain, _, currentBlock, signer, signFn, _ := PrepareXDCTestBlockChainForV2Engine(t, 905, params.TestXDPoSMockChainConfig, nil) engineV2 := blockchain.Engine().(*XDPoS.XDPoS).EngineV2 @@ -231,6 +232,7 @@ func TestShouldNotSetNewRound(t *testing.T) { } func TestShouldNotSendVoteMessageIfAlreadyVoteForThisRound(t *testing.T) { + skipLongInShortMode(t) blockchain, _, currentBlock, _, _, _ := PrepareXDCTestBlockChainForV2Engine(t, 906, params.TestXDPoSMockChainConfig, nil) engineV2 := blockchain.Engine().(*XDPoS.XDPoS).EngineV2 @@ -269,6 +271,7 @@ func TestShouldNotSendVoteMessageIfAlreadyVoteForThisRound(t *testing.T) { } func TestShouldNotSendVoteMsgIfBlockInfoRoundNotEqualCurrentRound(t *testing.T) { + skipLongInShortMode(t) blockchain, _, currentBlock, _, _, _ := PrepareXDCTestBlockChainForV2Engine(t, 906, params.TestXDPoSMockChainConfig, nil) engineV2 := blockchain.Engine().(*XDPoS.XDPoS).EngineV2 @@ -302,6 +305,7 @@ func TestShouldNotSendVoteMsgIfBlockInfoRoundNotEqualCurrentRound(t *testing.T) \ 14'(7) */ func TestShouldNotSendVoteMsgIfBlockNotExtendedFromAncestor(t *testing.T) { + skipLongInShortMode(t) // Block number 905, 906 have forks and forkedBlock is the 906th var numOfForks = new(int) *numOfForks = 3 @@ -360,6 +364,7 @@ func TestShouldSendVoteMsg(t *testing.T) { } func TestProposedBlockMessageHandlerNotGenerateVoteIfSignerNotInMNlist(t *testing.T) { + skipLongInShortMode(t) blockchain, _, currentBlock, _, _, _ := PrepareXDCTestBlockChainForV2Engine(t, 906, params.TestXDPoSMockChainConfig, nil) engineV2 := blockchain.Engine().(*XDPoS.XDPoS).EngineV2 differentSigner, differentSignFn, err := backends.SimulateWalletAddressAndSignFn() diff --git a/consensus/tests/engine_v2_tests/reward_test.go b/consensus/tests/engine_v2_tests/reward_test.go index 4e03cd3581..51eb0f3aa8 100644 --- a/consensus/tests/engine_v2_tests/reward_test.go +++ b/consensus/tests/engine_v2_tests/reward_test.go @@ -15,6 +15,7 @@ import ( ) func TestHookRewardV2(t *testing.T) { + skipLongInShortMode(t) b, err := json.Marshal(params.TestXDPoSMockChainConfig) assert.Nil(t, err) configString := string(b) @@ -96,6 +97,7 @@ func TestHookRewardV2(t *testing.T) { } func TestHookRewardV2SplitReward(t *testing.T) { + skipLongInShortMode(t) b, err := json.Marshal(params.TestXDPoSMockChainConfig) assert.Nil(t, err) configString := string(b) @@ -166,6 +168,7 @@ func TestHookRewardV2SplitReward(t *testing.T) { } func TestHookRewardAfterUpgrade(t *testing.T) { + skipLongInShortMode(t) b, err := json.Marshal(params.TestXDPoSMockChainConfig) assert.Nil(t, err) configString := string(b) @@ -313,6 +316,7 @@ func TestHookRewardAfterUpgrade(t *testing.T) { } func TestFinalizeAfterUpgrade(t *testing.T) { + skipLongInShortMode(t) b, err := json.Marshal(params.TestXDPoSMockChainConfig) assert.Nil(t, err) configString := string(b) @@ -381,6 +385,7 @@ func TestFinalizeAfterUpgrade(t *testing.T) { } func TestRewardHalvingVanishing(t *testing.T) { + skipLongInShortMode(t) billion := big.NewInt(1000000000) epochRewardTotal := big.NewInt(16000) epochRewardTotal.Mul(epochRewardTotal, billion) diff --git a/consensus/tests/engine_v2_tests/sync_info_test.go b/consensus/tests/engine_v2_tests/sync_info_test.go index a04d1d8b42..a31317df66 100644 --- a/consensus/tests/engine_v2_tests/sync_info_test.go +++ b/consensus/tests/engine_v2_tests/sync_info_test.go @@ -176,6 +176,7 @@ func TestVerifySyncInfoIfTCRoundIsAtNextEpoch(t *testing.T) { } func TestVerifySyncInfoIfTcUseDifferentEpoch(t *testing.T) { + skipLongInShortMode(t) config := params.TestXDPoSMockChainConfig blockchain, _, currentBlock, signer, signFn, _ := PrepareXDCTestBlockChainForV2Engine(t, 1349, config, nil) adaptor := blockchain.Engine().(*XDPoS.XDPoS) diff --git a/consensus/tests/engine_v2_tests/timeout_test.go b/consensus/tests/engine_v2_tests/timeout_test.go index dccb569252..28f704d644 100644 --- a/consensus/tests/engine_v2_tests/timeout_test.go +++ b/consensus/tests/engine_v2_tests/timeout_test.go @@ -17,6 +17,7 @@ import ( ) func TestCountdownTimeoutToSendTimeoutMessage(t *testing.T) { + skipLongInShortMode(t) blockchain, _, _, _, _, _ := PrepareXDCTestBlockChainForV2Engine(t, 901, params.TestXDPoSMockChainConfig, nil) engineV2 := blockchain.Engine().(*XDPoS.XDPoS).EngineV2 @@ -29,6 +30,7 @@ func TestCountdownTimeoutToSendTimeoutMessage(t *testing.T) { } func TestCountdownTimeoutNotToSendTimeoutMessageIfNotInMasternodeList(t *testing.T) { + skipLongInShortMode(t) blockchain, _, _, _, _, _ := PrepareXDCTestBlockChainForV2Engine(t, 901, params.TestXDPoSMockChainConfig, nil) engineV2 := blockchain.Engine().(*XDPoS.XDPoS).EngineV2 @@ -47,6 +49,7 @@ func TestCountdownTimeoutNotToSendTimeoutMessageIfNotInMasternodeList(t *testing } func TestSyncInfoAfterReachTimeoutSyncThreadhold(t *testing.T) { + skipLongInShortMode(t) blockchain, _, _, _, _, _ := PrepareXDCTestBlockChainForV2Engine(t, 901, params.TestXDPoSMockChainConfig, nil) engineV2 := blockchain.Engine().(*XDPoS.XDPoS).EngineV2 engineV2.SetNewRoundFaker(blockchain, 1, true) @@ -85,6 +88,7 @@ func TestSyncInfoAfterReachTimeoutSyncThreadhold(t *testing.T) { } func TestTimeoutPeriodAndThreadholdConfigChange(t *testing.T) { + skipLongInShortMode(t) blockchain, _, currentBlock, signer, signFn, _ := PrepareXDCTestBlockChainForV2Engine(t, 1799, params.TestXDPoSMockChainConfig, nil) engineV2 := blockchain.Engine().(*XDPoS.XDPoS).EngineV2 // engineV2.SetNewRoundFaker(blockchain, 1, true) @@ -140,6 +144,7 @@ func TestTimeoutPeriodAndThreadholdConfigChange(t *testing.T) { // Timeout handler func TestTimeoutMessageHandlerSuccessfullyGenerateTCandSyncInfoAfterReachingThreshold(t *testing.T) { + skipLongInShortMode(t) blockchain, _, _, _, _, _ := PrepareXDCTestBlockChainForV2Engine(t, 905, params.TestXDPoSMockChainConfig, nil) engineV2 := blockchain.Engine().(*XDPoS.XDPoS).EngineV2 @@ -289,6 +294,7 @@ func TestShouldVerifyTimeoutMessageForFirstV2Block(t *testing.T) { } func TestShouldVerifyTimeoutMessage(t *testing.T) { + skipLongInShortMode(t) blockchain, _, _, _, _, _ := PrepareXDCTestBlockChainForV2Engine(t, 2251, params.TestXDPoSMockChainConfig, nil) engineV2 := blockchain.Engine().(*XDPoS.XDPoS).EngineV2 @@ -308,6 +314,7 @@ func TestShouldVerifyTimeoutMessage(t *testing.T) { } func TestTimeoutPoolKeyGoodHygiene(t *testing.T) { + skipLongInShortMode(t) blockchain, _, _, signer, signFn, _ := PrepareXDCTestBlockChainForV2Engine(t, 905, params.TestXDPoSMockChainConfig, nil) engineV2 := blockchain.Engine().(*XDPoS.XDPoS).EngineV2 @@ -371,6 +378,7 @@ func TestTimeoutPoolKeyGoodHygiene(t *testing.T) { } func TestGetTCEpochInfo(t *testing.T) { + skipLongInShortMode(t) // First epoch, round 1, switch block 901 // Second epoch, round 901, block 1800 blockchain, _, _, _, _, _ := PrepareXDCTestBlockChainForV2Engine(t, 1805, params.TestXDPoSMockChainConfig, nil) diff --git a/consensus/tests/engine_v2_tests/verify_header_test.go b/consensus/tests/engine_v2_tests/verify_header_test.go index c7f494bbef..96466b5855 100644 --- a/consensus/tests/engine_v2_tests/verify_header_test.go +++ b/consensus/tests/engine_v2_tests/verify_header_test.go @@ -263,6 +263,7 @@ func TestConfigSwitchOnDifferentCertThreshold(t *testing.T) { This is to simulate node is syncing from remote during config switch */ func TestConfigSwitchOnDifferentMasternodeCount(t *testing.T) { + skipLongInShortMode(t) b, err := json.Marshal(params.TestXDPoSMockChainConfig) assert.Nil(t, err) configString := string(b) @@ -399,6 +400,7 @@ func TestShouldFailIfNotEnoughQCSignatures(t *testing.T) { } func TestShouldVerifyHeaders(t *testing.T) { + skipLongInShortMode(t) b, err := json.Marshal(params.TestXDPoSMockChainConfig) assert.Nil(t, err) configString := string(b) @@ -436,6 +438,7 @@ func TestShouldVerifyHeaders(t *testing.T) { } func TestShouldVerifyHeadersEvenIfParentsNotYetWrittenIntoDB(t *testing.T) { + skipLongInShortMode(t) b, err := json.Marshal(params.TestXDPoSMockChainConfig) assert.Nil(t, err) configString := string(b) diff --git a/consensus/tests/engine_v2_tests/vote_test.go b/consensus/tests/engine_v2_tests/vote_test.go index 93c2a0d9ed..948ba68b43 100644 --- a/consensus/tests/engine_v2_tests/vote_test.go +++ b/consensus/tests/engine_v2_tests/vote_test.go @@ -614,6 +614,7 @@ func TestVoteMessageHandlerWrongGapNumber(t *testing.T) { } func TestVotePoolKeepGoodHygiene(t *testing.T) { + skipLongInShortMode(t) blockchain, _, currentBlock, signer, signFn, _ := PrepareXDCTestBlockChainForV2Engine(t, 905, params.TestXDPoSMockChainConfig, nil) engineV2 := blockchain.Engine().(*XDPoS.XDPoS).EngineV2 diff --git a/core/bench_test.go b/core/bench_test.go index b5892eb480..f9b2326dba 100644 --- a/core/bench_test.go +++ b/core/bench_test.go @@ -182,37 +182,66 @@ func benchInsertChain(b *testing.B, disk bool, gen func(int, *BlockGen)) { func BenchmarkChainRead_header_10k(b *testing.B) { benchReadChain(b, false, 10000) } + func BenchmarkChainRead_full_10k(b *testing.B) { benchReadChain(b, true, 10000) } + func BenchmarkChainRead_header_100k(b *testing.B) { + if testing.Short() { + b.Skip("Skipping in short-mode") + } benchReadChain(b, false, 100000) } + func BenchmarkChainRead_full_100k(b *testing.B) { + if testing.Short() { + b.Skip("Skipping in short-mode") + } benchReadChain(b, true, 100000) } + func BenchmarkChainRead_header_500k(b *testing.B) { + if testing.Short() { + b.Skip("Skipping in short-mode") + } benchReadChain(b, false, 500000) } + func BenchmarkChainRead_full_500k(b *testing.B) { + if testing.Short() { + b.Skip("Skipping in short-mode") + } benchReadChain(b, true, 500000) } + func BenchmarkChainWrite_header_10k(b *testing.B) { benchWriteChain(b, false, 10000) } + func BenchmarkChainWrite_full_10k(b *testing.B) { benchWriteChain(b, true, 10000) } + func BenchmarkChainWrite_header_100k(b *testing.B) { benchWriteChain(b, false, 100000) } + func BenchmarkChainWrite_full_100k(b *testing.B) { benchWriteChain(b, true, 100000) } + func BenchmarkChainWrite_header_500k(b *testing.B) { + if testing.Short() { + b.Skip("Skipping in short-mode") + } benchWriteChain(b, false, 500000) } + func BenchmarkChainWrite_full_500k(b *testing.B) { + if testing.Short() { + b.Skip("Skipping in short-mode") + } benchWriteChain(b, true, 500000) }