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.
This commit is contained in:
Seebs 2019-10-11 13:59:43 -05:00
parent 7a381f7eaf
commit 616ed39771

View file

@ -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")
}
}