From 8fce7083c1ac01211903db28d69cc67c620decd8 Mon Sep 17 00:00:00 2001 From: Evan Culver Date: Fri, 9 Jul 2021 16:42:30 -0700 Subject: [PATCH] tests: skip cases that depend on test server when -short flag set (#10576) --- api/api_test.go | 5 +++++ api/watch/funcs_test.go | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/api/api_test.go b/api/api_test.go index 56f764d830..5b7f557cae 100644 --- a/api/api_test.go +++ b/api/api_test.go @@ -50,6 +50,11 @@ func makeClientWithConfig( t *testing.T, cb1 configCallback, cb2 testutil.ServerConfigCallback) (*Client, *testutil.TestServer) { + // Skip test when -short flag provided; any tests that create a test + // server will take at least 100ms which is undesirable for -short + if testing.Short() { + t.Skip("too slow for testing.Short") + } // Make client config conf := DefaultConfig() diff --git a/api/watch/funcs_test.go b/api/watch/funcs_test.go index 10c67da4e6..1c23654f04 100644 --- a/api/watch/funcs_test.go +++ b/api/watch/funcs_test.go @@ -24,6 +24,12 @@ import ( ) func makeClient(t *testing.T) (*api.Client, *testutil.TestServer) { + // Skip test when -short flag provided; any tests that create a test server + // will take at least 100ms which is undesirable for -short + if testing.Short() { + t.Skip("too slow for testing.Short") + } + // Make client config conf := api.DefaultConfig()