From 4f0a85272ec2cb8bd1cc9a6c806f8bbce3568ce1 Mon Sep 17 00:00:00 2001 From: Mark Rushakoff Date: Fri, 22 Jul 2022 11:27:02 -0400 Subject: [PATCH] Skip long node 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 node from about 7.7s to about 0.9s. The difference is much more pronounced with the race detector enabled, about 33s without -short and about 1.4s with -short. --- node/node_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/node/node_test.go b/node/node_test.go index 245e39b3c..6103d554e 100644 --- a/node/node_test.go +++ b/node/node_test.go @@ -106,6 +106,10 @@ func getTestNode(ctx context.Context, t *testing.T, conf *config.Config, logger } func TestNodeDelayedStart(t *testing.T) { + if testing.Short() { + t.Skip("skipping test in short mode") + } + cfg, err := config.ResetTestRoot(t.TempDir(), "node_delayed_start_test") require.NoError(t, err) @@ -195,6 +199,10 @@ func TestNodeSetPrivValTCP(t *testing.T) { // address without a protocol must result in error func TestPrivValidatorListenAddrNoProtocol(t *testing.T) { + if testing.Short() { + t.Skip("skipping test in short mode") + } + ctx, cancel := context.WithCancel(context.Background()) defer cancel() @@ -441,6 +449,10 @@ func TestMaxTxsProposalBlockSize(t *testing.T) { } func TestMaxProposalBlockSize(t *testing.T) { + if testing.Short() { + t.Skip("skipping test in short mode") + } + ctx, cancel := context.WithCancel(context.Background()) defer cancel()