From 6daef21b52c0a4639369cf2dfdceb5ef66caf8d2 Mon Sep 17 00:00:00 2001 From: Mark Rushakoff Date: Fri, 22 Jul 2022 11:51:21 -0400 Subject: [PATCH] Skip long internal/p2p/conn 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 internal/p2p/conn from about 21.7s to about 1.9s. --- internal/p2p/conn/connection_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/internal/p2p/conn/connection_test.go b/internal/p2p/conn/connection_test.go index 5a604cd23..2f497bdd4 100644 --- a/internal/p2p/conn/connection_test.go +++ b/internal/p2p/conn/connection_test.go @@ -315,6 +315,10 @@ func TestMConnectionMultiplePings(t *testing.T) { } func TestMConnectionPingPongs(t *testing.T) { + if testing.Short() { + t.Skip("skipping test in short mode") + } + // check that we are not leaking any go-routines t.Cleanup(leaktest.CheckTimeout(t, 10*time.Second)) @@ -558,6 +562,10 @@ func TestMConnectionReadErrorUnknownMsgType(t *testing.T) { } func TestMConnectionTrySend(t *testing.T) { + if testing.Short() { + t.Skip("skipping test in short mode") + } + server, client := net.Pipe() t.Cleanup(closeAll(t, client, server)) ctx, cancel := context.WithCancel(context.Background()) @@ -606,6 +614,10 @@ func TestConnVectors(t *testing.T) { } func TestMConnectionChannelOverflow(t *testing.T) { + if testing.Short() { + t.Skip("skipping test in short mode") + } + chOnErr := make(chan struct{}) chOnRcv := make(chan struct{})