mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 21:31:37 +00:00
test(consensus,core): skip long-running tests in short mode (#2129)
This commit is contained in:
parent
e9043cceb2
commit
bad1116a28
13 changed files with 81 additions and 0 deletions
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue