mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-08 22:23:11 +00:00
Skip long types tests in -short mode
I added checks against testing.Short for tests that took longer than about one second on my machine. Running with -short reduces the test time of types from about 21s to about 1.9s with the race detector enabled. With the race detector disabled, the timing difference is about 1.0s to about 0.3s.
This commit is contained in:
@@ -16,6 +16,10 @@ const (
|
||||
)
|
||||
|
||||
func TestBasicPartSet(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping test in short mode")
|
||||
}
|
||||
|
||||
// Construct random data of size partSize * 100
|
||||
nParts := 100
|
||||
data := tmrand.Bytes(testPartSize * nParts)
|
||||
@@ -64,6 +68,10 @@ func TestBasicPartSet(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestWrongProof(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping test in short mode")
|
||||
}
|
||||
|
||||
// Construct random data of size partSize * 100
|
||||
data := tmrand.Bytes(testPartSize * 100)
|
||||
partSet := NewPartSetFromData(data, testPartSize)
|
||||
@@ -89,6 +97,10 @@ func TestWrongProof(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestPartSetHeaderValidateBasic(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping test in short mode")
|
||||
}
|
||||
|
||||
testCases := []struct {
|
||||
testName string
|
||||
malleatePartSetHeader func(*PartSetHeader)
|
||||
@@ -110,6 +122,10 @@ func TestPartSetHeaderValidateBasic(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestPartValidateBasic(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping test in short mode")
|
||||
}
|
||||
|
||||
testCases := []struct {
|
||||
testName string
|
||||
malleatePart func(*Part)
|
||||
|
||||
@@ -1207,6 +1207,10 @@ func applyChangesToValSet(t *testing.T, expErr error, valSet *ValidatorSet, vals
|
||||
}
|
||||
|
||||
func TestValSetUpdatePriorityOrderTests(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping test in short mode")
|
||||
}
|
||||
|
||||
const nMaxElections int32 = 5000
|
||||
|
||||
testCases := []testVSetCfg{
|
||||
|
||||
Reference in New Issue
Block a user