From 616ed39771891223be89f672185cd1b2c37ad38c Mon Sep 17 00:00:00 2001 From: Seebs Date: Fri, 11 Oct 2019 13:59:43 -0500 Subject: [PATCH] Skip longest tests when running -short The cluster timeout/down tests are way more than half the total time for "go test", and are very unlikely to be of interest in regular usage, although they matter for CI. Skip them when doing short tests. --- cluster_internal_test.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cluster_internal_test.go b/cluster_internal_test.go index 79a28f4ae..dad42d31f 100644 --- a/cluster_internal_test.go +++ b/cluster_internal_test.go @@ -948,6 +948,9 @@ func TestCluster_confirmNodeDownUp(t *testing.T) { } func TestCluster_confirmNodeDownTimeout(t *testing.T) { + if testing.Short() { + t.Skip() + } r := mux.NewRouter() r.HandleFunc("/version", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { time.Sleep(confirmDownSleep * time.Second * confirmDownRetries) @@ -973,10 +976,12 @@ func TestCluster_confirmNodeDownTimeout(t *testing.T) { if !confirmNodeDown(uri, logger.NewVerboseLogger(os.Stdout)) { t.Errorf("expected node to be down") } - } func TestCluster_confirmNodeDownDown(t *testing.T) { + if testing.Short() { + t.Skip() + } uri := URI{} uri.Scheme = "http" uri.Host = "DoesntMatter" @@ -985,5 +990,4 @@ func TestCluster_confirmNodeDownDown(t *testing.T) { if !confirmNodeDown(uri, logger.NewVerboseLogger(os.Stdout)) { t.Errorf("expected node to be down") } - }