From 1b026de1db829a1903f2963bd1e13a2ba381f399 Mon Sep 17 00:00:00 2001 From: Frank Schroeder Date: Tue, 17 Oct 2017 16:07:48 +0200 Subject: [PATCH] commands: run all tests in parallel (again) --- command/agent/agent_test.go | 6 ++++++ command/catalog/catalog_test.go | 1 + .../catalog/list/dc/catalog_list_datacenters_test.go | 3 +++ command/catalog/list/nodes/catalog_list_nodes_test.go | 3 +++ .../list/services/catalog_list_services_test.go | 3 +++ command/event/event_test.go | 2 ++ command/exec/exec_test.go | 9 +++++++++ command/flags/config_test.go | 2 ++ command/flags/flag_map_value_test.go | 1 + command/flags/flag_slice_value_test.go | 2 ++ command/forceleave/forceleave_test.go | 3 +++ command/info/info_test.go | 2 ++ command/join/join_test.go | 4 ++++ command/keygen/keygen_test.go | 2 ++ command/keyring/keyring_test.go | 5 +++++ command/kv/del/kv_delete_test.go | 5 +++++ command/kv/exp/kv_export_test.go | 2 ++ command/kv/get/kv_get_test.go | 10 ++++++++++ command/kv/imp/kv_import_test.go | 2 ++ command/kv/kv_test.go | 1 + command/kv/put/kv_put_test.go | 11 +++++++++++ command/leave/leave_test.go | 3 +++ command/lock/lock_test.go | 11 +++++++++++ command/maint/maint_test.go | 8 ++++++++ command/members/members_test.go | 5 +++++ .../autopilot/get/operator_autopilot_get_test.go | 2 ++ command/operator/autopilot/operator_autopilot_test.go | 1 + .../autopilot/set/operator_autopilot_set_test.go | 2 ++ command/operator/operator_test.go | 1 + .../raft/listpeers/operator_raft_list_test.go | 2 ++ command/operator/raft/operator_raft_test.go | 1 + .../raft/removepeer/operator_raft_remove_test.go | 2 ++ command/reload/reload_test.go | 2 ++ command/rtt/rtt_test.go | 4 ++++ command/snapshot/inspect/snapshot_inspect_test.go | 3 +++ command/snapshot/restore/snapshot_restore_test.go | 3 +++ command/snapshot/save/snapshot_save_test.go | 3 +++ command/snapshot/snapshot_command_test.go | 1 + command/validate/validate_test.go | 5 +++++ command/version/version_test.go | 1 + command/watch/watch_test.go | 2 ++ 41 files changed, 141 insertions(+) diff --git a/command/agent/agent_test.go b/command/agent/agent_test.go index 5b08e0e140..7a307c3eca 100644 --- a/command/agent/agent_test.go +++ b/command/agent/agent_test.go @@ -18,6 +18,7 @@ import ( // TestConfigFail should test command line flags that lead to an immediate error. func TestConfigFail(t *testing.T) { + t.Parallel() dataDir := testutil.TempDir(t, "consul") defer os.RemoveAll(dataDir) @@ -75,6 +76,7 @@ func TestConfigFail(t *testing.T) { } func TestRetryJoin(t *testing.T) { + t.Parallel() t.Skip("fs: skipping tests that use cmd.Run until signal handling is fixed") a := agent.NewTestAgent(t.Name(), "") defer a.Shutdown() @@ -123,6 +125,7 @@ func TestRetryJoin(t *testing.T) { } func TestRetryJoinFail(t *testing.T) { + t.Parallel() t.Skip("fs: skipping tests that use cmd.Run until signal handling is fixed") cfg := agent.TestConfig() tmpDir := testutil.TempDir(t, "consul") @@ -148,6 +151,7 @@ func TestRetryJoinFail(t *testing.T) { } func TestRetryJoinWanFail(t *testing.T) { + t.Parallel() t.Skip("fs: skipping tests that use cmd.Run until signal handling is fixed") cfg := agent.TestConfig() tmpDir := testutil.TempDir(t, "consul") @@ -174,6 +178,7 @@ func TestRetryJoinWanFail(t *testing.T) { } func TestProtectDataDir(t *testing.T) { + t.Parallel() dir := testutil.TempDir(t, "consul") defer os.RemoveAll(dir) @@ -208,6 +213,7 @@ func TestProtectDataDir(t *testing.T) { } func TestBadDataDirPermissions(t *testing.T) { + t.Parallel() dir := testutil.TempDir(t, "consul") defer os.RemoveAll(dir) diff --git a/command/catalog/catalog_test.go b/command/catalog/catalog_test.go index 576101016e..9c5ffbdbaf 100644 --- a/command/catalog/catalog_test.go +++ b/command/catalog/catalog_test.go @@ -6,6 +6,7 @@ import ( ) func TestCatalogCommand_noTabs(t *testing.T) { + t.Parallel() if strings.ContainsRune(New().Help(), '\t') { t.Fatal("help has tabs") } diff --git a/command/catalog/list/dc/catalog_list_datacenters_test.go b/command/catalog/list/dc/catalog_list_datacenters_test.go index 87b07edf81..1446bf85c5 100644 --- a/command/catalog/list/dc/catalog_list_datacenters_test.go +++ b/command/catalog/list/dc/catalog_list_datacenters_test.go @@ -9,12 +9,14 @@ import ( ) func TestCatalogListDatacentersCommand_noTabs(t *testing.T) { + t.Parallel() if strings.ContainsRune(New(nil).Help(), '\t') { t.Fatal("help has tabs") } } func TestCatalogListDatacentersCommand_Validation(t *testing.T) { + t.Parallel() ui := cli.NewMockUi() c := New(ui) @@ -50,6 +52,7 @@ func TestCatalogListDatacentersCommand_Validation(t *testing.T) { } func TestCatalogListDatacentersCommand(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() diff --git a/command/catalog/list/nodes/catalog_list_nodes_test.go b/command/catalog/list/nodes/catalog_list_nodes_test.go index bc1916bfd3..69ce5f893d 100644 --- a/command/catalog/list/nodes/catalog_list_nodes_test.go +++ b/command/catalog/list/nodes/catalog_list_nodes_test.go @@ -9,12 +9,14 @@ import ( ) func TestCatalogListNodesCommand_noTabs(t *testing.T) { + t.Parallel() if strings.ContainsRune(New(nil).Help(), '\t') { t.Fatal("help has tabs") } } func TestCatalogListNodesCommand_Validation(t *testing.T) { + t.Parallel() ui := cli.NewMockUi() c := New(ui) @@ -28,6 +30,7 @@ func TestCatalogListNodesCommand_Validation(t *testing.T) { } func TestCatalogListNodesCommand(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() diff --git a/command/catalog/list/services/catalog_list_services_test.go b/command/catalog/list/services/catalog_list_services_test.go index 171e534ce1..bc9b2e1b4a 100644 --- a/command/catalog/list/services/catalog_list_services_test.go +++ b/command/catalog/list/services/catalog_list_services_test.go @@ -10,12 +10,14 @@ import ( ) func TestCatalogListServicesCommand_noTabs(t *testing.T) { + t.Parallel() if strings.ContainsRune(New(nil).Help(), '\t') { t.Fatal("help has tabs") } } func TestCatalogListServicesCommand_Validation(t *testing.T) { + t.Parallel() ui := cli.NewMockUi() c := New(ui) @@ -29,6 +31,7 @@ func TestCatalogListServicesCommand_Validation(t *testing.T) { } func TestCatalogListServicesCommand(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() diff --git a/command/event/event_test.go b/command/event/event_test.go index fdba0659a5..b3a17f1348 100644 --- a/command/event/event_test.go +++ b/command/event/event_test.go @@ -9,12 +9,14 @@ import ( ) func TestEventCommand_noTabs(t *testing.T) { + t.Parallel() if strings.ContainsRune(New(nil).Help(), '\t') { t.Fatal("help has tabs") } } func TestEventCommand(t *testing.T) { + t.Parallel() a1 := agent.NewTestAgent(t.Name(), ``) defer a1.Shutdown() diff --git a/command/exec/exec_test.go b/command/exec/exec_test.go index 938b804792..b7d7179fe1 100644 --- a/command/exec/exec_test.go +++ b/command/exec/exec_test.go @@ -12,12 +12,14 @@ import ( ) func TestExecCommand_noTabs(t *testing.T) { + t.Parallel() if strings.ContainsRune(New(nil, nil).Help(), '\t') { t.Fatal("help has tabs") } } func TestExecCommand(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ` disable_remote_exec = false `) @@ -38,6 +40,7 @@ func TestExecCommand(t *testing.T) { } func TestExecCommand_NoShell(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ` disable_remote_exec = false `) @@ -58,6 +61,7 @@ func TestExecCommand_NoShell(t *testing.T) { } func TestExecCommand_CrossDC(t *testing.T) { + t.Parallel() a1 := agent.NewTestAgent(t.Name(), ` disable_remote_exec = false `) @@ -99,6 +103,7 @@ func TestExecCommand_CrossDC(t *testing.T) { } func TestExecCommand_Validate(t *testing.T) { + t.Parallel() conf := &rExecConf{} err := conf.validate() if err != nil { @@ -134,6 +139,7 @@ func TestExecCommand_Validate(t *testing.T) { } func TestExecCommand_Sessions(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ` disable_remote_exec = false `) @@ -172,6 +178,7 @@ func TestExecCommand_Sessions(t *testing.T) { } func TestExecCommand_Sessions_Foreign(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ` disable_remote_exec = false `) @@ -221,6 +228,7 @@ func TestExecCommand_Sessions_Foreign(t *testing.T) { } func TestExecCommand_UploadDestroy(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ` disable_remote_exec = false `) @@ -275,6 +283,7 @@ func TestExecCommand_UploadDestroy(t *testing.T) { } func TestExecCommand_StreamResults(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ` disable_remote_exec = false `) diff --git a/command/flags/config_test.go b/command/flags/config_test.go index ba8cf7bb75..7954fa6684 100644 --- a/command/flags/config_test.go +++ b/command/flags/config_test.go @@ -13,6 +13,7 @@ import ( ) func TestConfigUtil_Values(t *testing.T) { + t.Parallel() type config struct { B BoolValue `mapstructure:"bool"` D DurationValue `mapstructure:"duration"` @@ -101,6 +102,7 @@ func TestConfigUtil_Values(t *testing.T) { } func TestConfigUtil_Visit(t *testing.T) { + t.Parallel() var trail []string visitor := func(path string) error { trail = append(trail, path) diff --git a/command/flags/flag_map_value_test.go b/command/flags/flag_map_value_test.go index 2f1a9716f0..cf582c44a2 100644 --- a/command/flags/flag_map_value_test.go +++ b/command/flags/flag_map_value_test.go @@ -6,6 +6,7 @@ import ( ) func TestFlagMapValueSet(t *testing.T) { + t.Parallel() t.Run("missing =", func(t *testing.T) { diff --git a/command/flags/flag_slice_value_test.go b/command/flags/flag_slice_value_test.go index c5292b010e..82dff4c377 100644 --- a/command/flags/flag_slice_value_test.go +++ b/command/flags/flag_slice_value_test.go @@ -7,6 +7,7 @@ import ( ) func TestAppendSliceValue_implements(t *testing.T) { + t.Parallel() var raw interface{} raw = new(AppendSliceValue) if _, ok := raw.(flag.Value); !ok { @@ -15,6 +16,7 @@ func TestAppendSliceValue_implements(t *testing.T) { } func TestAppendSliceValueSet(t *testing.T) { + t.Parallel() sv := new(AppendSliceValue) err := sv.Set("foo") if err != nil { diff --git a/command/forceleave/forceleave_test.go b/command/forceleave/forceleave_test.go index 04ebb1d27d..85262ab193 100644 --- a/command/forceleave/forceleave_test.go +++ b/command/forceleave/forceleave_test.go @@ -11,12 +11,14 @@ import ( ) func TestForceLeaveCommand_noTabs(t *testing.T) { + t.Parallel() if strings.ContainsRune(New(nil).Help(), '\t') { t.Fatal("help has tabs") } } func TestForceLeaveCommand(t *testing.T) { + t.Parallel() a1 := agent.NewTestAgent(t.Name(), ``) a2 := agent.NewTestAgent(t.Name(), ``) defer a1.Shutdown() @@ -55,6 +57,7 @@ func TestForceLeaveCommand(t *testing.T) { } func TestForceLeaveCommand_noAddrs(t *testing.T) { + t.Parallel() ui := cli.NewMockUi() c := New(ui) args := []string{"-http-addr=foo"} diff --git a/command/info/info_test.go b/command/info/info_test.go index 75605250fb..9761b02f30 100644 --- a/command/info/info_test.go +++ b/command/info/info_test.go @@ -9,12 +9,14 @@ import ( ) func TestInfoCommand_noTabs(t *testing.T) { + t.Parallel() if strings.ContainsRune(New(nil).Help(), '\t') { t.Fatal("help has tabs") } } func TestInfoCommand(t *testing.T) { + t.Parallel() a1 := agent.NewTestAgent(t.Name(), ``) defer a1.Shutdown() diff --git a/command/join/join_test.go b/command/join/join_test.go index 895b26ec0a..f25e9789e4 100644 --- a/command/join/join_test.go +++ b/command/join/join_test.go @@ -9,12 +9,14 @@ import ( ) func TestJoinCommand_noTabs(t *testing.T) { + t.Parallel() if strings.ContainsRune(New(nil).Help(), '\t') { t.Fatal("help has tabs") } } func TestJoinCommandJoin_lan(t *testing.T) { + t.Parallel() a1 := agent.NewTestAgent(t.Name(), ``) a2 := agent.NewTestAgent(t.Name(), ``) defer a1.Shutdown() @@ -38,6 +40,7 @@ func TestJoinCommandJoin_lan(t *testing.T) { } func TestJoinCommand_wan(t *testing.T) { + t.Parallel() a1 := agent.NewTestAgent(t.Name(), ``) a2 := agent.NewTestAgent(t.Name(), ``) defer a1.Shutdown() @@ -62,6 +65,7 @@ func TestJoinCommand_wan(t *testing.T) { } func TestJoinCommand_noAddrs(t *testing.T) { + t.Parallel() ui := cli.NewMockUi() cmd := New(ui) args := []string{"-http-addr=foo"} diff --git a/command/keygen/keygen_test.go b/command/keygen/keygen_test.go index 6160ab1c20..fe94906e65 100644 --- a/command/keygen/keygen_test.go +++ b/command/keygen/keygen_test.go @@ -9,12 +9,14 @@ import ( ) func TestKeygenCommand_noTabs(t *testing.T) { + t.Parallel() if strings.ContainsRune(New(nil).Help(), '\t') { t.Fatal("help has tabs") } } func TestKeygenCommand(t *testing.T) { + t.Parallel() ui := cli.NewMockUi() cmd := New(ui) code := cmd.Run(nil) diff --git a/command/keyring/keyring_test.go b/command/keyring/keyring_test.go index 5b706cc45a..2426dd247b 100644 --- a/command/keyring/keyring_test.go +++ b/command/keyring/keyring_test.go @@ -9,12 +9,14 @@ import ( ) func TestKeyringCommand_noTabs(t *testing.T) { + t.Parallel() if strings.ContainsRune(New(nil).Help(), '\t') { t.Fatal("help has tabs") } } func TestKeyringCommand(t *testing.T) { + t.Parallel() key1 := "HS5lJ+XuTlYKWaeGYyG+/A==" key2 := "kZyFABeAmc64UMTrm9XuKA==" @@ -65,6 +67,7 @@ func TestKeyringCommand(t *testing.T) { } func TestKeyringCommand_help(t *testing.T) { + t.Parallel() ui := cli.NewMockUi() c := New(ui) code := c.Run(nil) @@ -79,6 +82,7 @@ func TestKeyringCommand_help(t *testing.T) { } func TestKeyringCommand_failedConnection(t *testing.T) { + t.Parallel() ui := cli.NewMockUi() c := New(ui) args := []string{"-list", "-http-addr=127.0.0.1:0"} @@ -92,6 +96,7 @@ func TestKeyringCommand_failedConnection(t *testing.T) { } func TestKeyringCommand_invalidRelayFactor(t *testing.T) { + t.Parallel() ui := cli.NewMockUi() c := New(ui) diff --git a/command/kv/del/kv_delete_test.go b/command/kv/del/kv_delete_test.go index bfe328223f..283aa004db 100644 --- a/command/kv/del/kv_delete_test.go +++ b/command/kv/del/kv_delete_test.go @@ -11,12 +11,14 @@ import ( ) func TestKVDeleteCommand_noTabs(t *testing.T) { + t.Parallel() if strings.ContainsRune(New(nil).Help(), '\t') { t.Fatal("help has tabs") } } func TestKVDeleteCommand_Validation(t *testing.T) { + t.Parallel() ui := cli.NewMockUi() c := New(ui) @@ -69,6 +71,7 @@ func TestKVDeleteCommand_Validation(t *testing.T) { } func TestKVDeleteCommand(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() client := a.Client() @@ -105,6 +108,7 @@ func TestKVDeleteCommand(t *testing.T) { } func TestKVDeleteCommand_Recurse(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() client := a.Client() @@ -148,6 +152,7 @@ func TestKVDeleteCommand_Recurse(t *testing.T) { } func TestKVDeleteCommand_CAS(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() client := a.Client() diff --git a/command/kv/exp/kv_export_test.go b/command/kv/exp/kv_export_test.go index 0a44b92f96..ca41d7a686 100644 --- a/command/kv/exp/kv_export_test.go +++ b/command/kv/exp/kv_export_test.go @@ -13,12 +13,14 @@ import ( ) func TestKVExportCommand_noTabs(t *testing.T) { + t.Parallel() if strings.ContainsRune(New(nil).Help(), '\t') { t.Fatal("help has tabs") } } func TestKVExportCommand(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() client := a.Client() diff --git a/command/kv/get/kv_get_test.go b/command/kv/get/kv_get_test.go index a5c12c2ba7..d072c00f27 100644 --- a/command/kv/get/kv_get_test.go +++ b/command/kv/get/kv_get_test.go @@ -11,12 +11,14 @@ import ( ) func TestKVGetCommand_noTabs(t *testing.T) { + t.Parallel() if strings.ContainsRune(New(nil).Help(), '\t') { t.Fatal("help has tabs") } } func TestKVGetCommand_Validation(t *testing.T) { + t.Parallel() ui := cli.NewMockUi() c := New(ui) @@ -56,6 +58,7 @@ func TestKVGetCommand_Validation(t *testing.T) { } func TestKVGetCommand(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() client := a.Client() @@ -89,6 +92,7 @@ func TestKVGetCommand(t *testing.T) { } func TestKVGetCommand_Missing(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() @@ -107,6 +111,7 @@ func TestKVGetCommand_Missing(t *testing.T) { } func TestKVGetCommand_Empty(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() client := a.Client() @@ -135,6 +140,7 @@ func TestKVGetCommand_Empty(t *testing.T) { } func TestKVGetCommand_Detailed(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() client := a.Client() @@ -178,6 +184,7 @@ func TestKVGetCommand_Detailed(t *testing.T) { } func TestKVGetCommand_Keys(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() client := a.Client() @@ -212,6 +219,7 @@ func TestKVGetCommand_Keys(t *testing.T) { } func TestKVGetCommand_Recurse(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() client := a.Client() @@ -251,6 +259,7 @@ func TestKVGetCommand_Recurse(t *testing.T) { } func TestKVGetCommand_RecurseBase64(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() client := a.Client() @@ -291,6 +300,7 @@ func TestKVGetCommand_RecurseBase64(t *testing.T) { } func TestKVGetCommand_DetailedBase64(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() client := a.Client() diff --git a/command/kv/imp/kv_import_test.go b/command/kv/imp/kv_import_test.go index 408bb8c96c..1d6f57f87e 100644 --- a/command/kv/imp/kv_import_test.go +++ b/command/kv/imp/kv_import_test.go @@ -9,12 +9,14 @@ import ( ) func TestKVImportCommand_noTabs(t *testing.T) { + t.Parallel() if strings.ContainsRune(New(nil).Help(), '\t') { t.Fatal("help has tabs") } } func TestKVImportCommand(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() client := a.Client() diff --git a/command/kv/kv_test.go b/command/kv/kv_test.go index 8ba81650cb..8a9bc25dfb 100644 --- a/command/kv/kv_test.go +++ b/command/kv/kv_test.go @@ -6,6 +6,7 @@ import ( ) func TestKVCommand_noTabs(t *testing.T) { + t.Parallel() if strings.ContainsRune(New().Help(), '\t') { t.Fatal("help has tabs") } diff --git a/command/kv/put/kv_put_test.go b/command/kv/put/kv_put_test.go index ec02333232..f837e4a903 100644 --- a/command/kv/put/kv_put_test.go +++ b/command/kv/put/kv_put_test.go @@ -16,12 +16,14 @@ import ( ) func TestKVPutCommand_noTabs(t *testing.T) { + t.Parallel() if strings.ContainsRune(New(nil).Help(), '\t') { t.Fatal("help has tabs") } } func TestKVPutCommand_Validation(t *testing.T) { + t.Parallel() ui := cli.NewMockUi() c := New(ui) @@ -74,6 +76,7 @@ func TestKVPutCommand_Validation(t *testing.T) { } func TestKVPutCommand(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() client := a.Client() @@ -102,6 +105,7 @@ func TestKVPutCommand(t *testing.T) { } func TestKVPutCommand_EmptyDataQuoted(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() client := a.Client() @@ -130,6 +134,7 @@ func TestKVPutCommand_EmptyDataQuoted(t *testing.T) { } func TestKVPutCommand_Base64(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() client := a.Client() @@ -166,6 +171,7 @@ func TestKVPutCommand_Base64(t *testing.T) { } func TestKVPutCommand_File(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() client := a.Client() @@ -200,6 +206,7 @@ func TestKVPutCommand_File(t *testing.T) { } func TestKVPutCommand_FileNoExist(t *testing.T) { + t.Parallel() ui := cli.NewMockUi() c := New(ui) @@ -219,6 +226,7 @@ func TestKVPutCommand_FileNoExist(t *testing.T) { } func TestKVPutCommand_Stdin(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() client := a.Client() @@ -255,6 +263,7 @@ func TestKVPutCommand_Stdin(t *testing.T) { } func TestKVPutCommand_NegativeVal(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() client := a.Client() @@ -283,6 +292,7 @@ func TestKVPutCommand_NegativeVal(t *testing.T) { } func TestKVPutCommand_Flags(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() client := a.Client() @@ -312,6 +322,7 @@ func TestKVPutCommand_Flags(t *testing.T) { } func TestKVPutCommand_CAS(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() client := a.Client() diff --git a/command/leave/leave_test.go b/command/leave/leave_test.go index f7d2a03086..553525ea97 100644 --- a/command/leave/leave_test.go +++ b/command/leave/leave_test.go @@ -9,12 +9,14 @@ import ( ) func TestLeaveCommand_noTabs(t *testing.T) { + t.Parallel() if strings.ContainsRune(New(nil).Help(), '\t') { t.Fatal("help has tabs") } } func TestLeaveCommand(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() @@ -33,6 +35,7 @@ func TestLeaveCommand(t *testing.T) { } func TestLeaveCommand_FailOnNonFlagArgs(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() diff --git a/command/lock/lock_test.go b/command/lock/lock_test.go index 7cde7ea9ea..0856e65187 100644 --- a/command/lock/lock_test.go +++ b/command/lock/lock_test.go @@ -26,18 +26,21 @@ func argFail(t *testing.T, args []string, expected string) { } func TestLockCommand_noTabs(t *testing.T) { + t.Parallel() if strings.ContainsRune(New(cli.NewMockUi()).Help(), '\t') { t.Fatal("help has tabs") } } func TestLockCommand_BadArgs(t *testing.T) { + t.Parallel() argFail(t, []string{"-try=blah", "test/prefix", "date"}, "invalid duration") argFail(t, []string{"-try=-10s", "test/prefix", "date"}, "Timeout must be positive") argFail(t, []string{"-monitor-retry=-5", "test/prefix", "date"}, "must be >= 0") } func TestLockCommand(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() @@ -60,6 +63,7 @@ func TestLockCommand(t *testing.T) { } func TestLockCommand_NoShell(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() @@ -82,6 +86,7 @@ func TestLockCommand_NoShell(t *testing.T) { } func TestLockCommand_TryLock(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() @@ -113,6 +118,7 @@ func TestLockCommand_TryLock(t *testing.T) { } func TestLockCommand_TrySemaphore(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() @@ -144,6 +150,7 @@ func TestLockCommand_TrySemaphore(t *testing.T) { } func TestLockCommand_MonitorRetry_Lock_Default(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() @@ -176,6 +183,7 @@ func TestLockCommand_MonitorRetry_Lock_Default(t *testing.T) { } func TestLockCommand_MonitorRetry_Semaphore_Default(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() @@ -208,6 +216,7 @@ func TestLockCommand_MonitorRetry_Semaphore_Default(t *testing.T) { } func TestLockCommand_MonitorRetry_Lock_Arg(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() @@ -240,6 +249,7 @@ func TestLockCommand_MonitorRetry_Lock_Arg(t *testing.T) { } func TestLockCommand_MonitorRetry_Semaphore_Arg(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() @@ -272,6 +282,7 @@ func TestLockCommand_MonitorRetry_Semaphore_Arg(t *testing.T) { } func TestLockCommand_ChildExitCode(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() diff --git a/command/maint/maint_test.go b/command/maint/maint_test.go index b7a22d5f71..7fa89c6f8b 100644 --- a/command/maint/maint_test.go +++ b/command/maint/maint_test.go @@ -10,12 +10,14 @@ import ( ) func TestMaintCommand_noTabs(t *testing.T) { + t.Parallel() if strings.ContainsRune(New(cli.NewMockUi()).Help(), '\t') { t.Fatal("help has tabs") } } func TestMaintCommand_ConflictingArgs(t *testing.T) { + t.Parallel() ui := cli.NewMockUi() c := New(ui) c.flags.SetOutput(ui.ErrorWriter) @@ -38,6 +40,7 @@ func TestMaintCommand_ConflictingArgs(t *testing.T) { } func TestMaintCommand_NoArgs(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() @@ -86,6 +89,7 @@ func TestMaintCommand_NoArgs(t *testing.T) { } func TestMaintCommand_EnableNodeMaintenance(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() @@ -109,6 +113,7 @@ func TestMaintCommand_EnableNodeMaintenance(t *testing.T) { } func TestMaintCommand_DisableNodeMaintenance(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() @@ -131,6 +136,7 @@ func TestMaintCommand_DisableNodeMaintenance(t *testing.T) { } func TestMaintCommand_EnableServiceMaintenance(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() @@ -164,6 +170,7 @@ func TestMaintCommand_EnableServiceMaintenance(t *testing.T) { } func TestMaintCommand_DisableServiceMaintenance(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() @@ -196,6 +203,7 @@ func TestMaintCommand_DisableServiceMaintenance(t *testing.T) { } func TestMaintCommand_ServiceMaintenance_NoService(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() diff --git a/command/members/members_test.go b/command/members/members_test.go index 8067e48d27..0ee2de10ca 100644 --- a/command/members/members_test.go +++ b/command/members/members_test.go @@ -10,12 +10,14 @@ import ( ) func TestMembersCommand_noTabs(t *testing.T) { + t.Parallel() if strings.ContainsRune(New(cli.NewMockUi()).Help(), '\t') { t.Fatal("help has tabs") } } func TestMembersCommand(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() @@ -47,6 +49,7 @@ func TestMembersCommand(t *testing.T) { } func TestMembersCommand_WAN(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() @@ -67,6 +70,7 @@ func TestMembersCommand_WAN(t *testing.T) { } func TestMembersCommand_statusFilter(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() @@ -90,6 +94,7 @@ func TestMembersCommand_statusFilter(t *testing.T) { } func TestMembersCommand_statusFilter_failed(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() diff --git a/command/operator/autopilot/get/operator_autopilot_get_test.go b/command/operator/autopilot/get/operator_autopilot_get_test.go index 9ef2aa1798..9fc44ce2c1 100644 --- a/command/operator/autopilot/get/operator_autopilot_get_test.go +++ b/command/operator/autopilot/get/operator_autopilot_get_test.go @@ -9,12 +9,14 @@ import ( ) func TestOperatorAutopilotGetConfigCommand_noTabs(t *testing.T) { + t.Parallel() if strings.ContainsRune(New(cli.NewMockUi()).Help(), '\t') { t.Fatal("help has tabs") } } func TestOperatorAutopilotGetConfigCommand(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() diff --git a/command/operator/autopilot/operator_autopilot_test.go b/command/operator/autopilot/operator_autopilot_test.go index cbd1d3b738..e82008dcd6 100644 --- a/command/operator/autopilot/operator_autopilot_test.go +++ b/command/operator/autopilot/operator_autopilot_test.go @@ -6,6 +6,7 @@ import ( ) func TestOperatorAutopilotCommand_noTabs(t *testing.T) { + t.Parallel() if strings.ContainsRune(New().Help(), '\t') { t.Fatal("help has tabs") } diff --git a/command/operator/autopilot/set/operator_autopilot_set_test.go b/command/operator/autopilot/set/operator_autopilot_set_test.go index 2f168898d1..cb5bc6e5a9 100644 --- a/command/operator/autopilot/set/operator_autopilot_set_test.go +++ b/command/operator/autopilot/set/operator_autopilot_set_test.go @@ -11,12 +11,14 @@ import ( ) func TestOperatorAutopilotSetConfigCommand_noTabs(t *testing.T) { + t.Parallel() if strings.ContainsRune(New(cli.NewMockUi()).Help(), '\t') { t.Fatal("help has tabs") } } func TestOperatorAutopilotSetConfigCommmand(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() diff --git a/command/operator/operator_test.go b/command/operator/operator_test.go index 3ed4a06808..f980e86096 100644 --- a/command/operator/operator_test.go +++ b/command/operator/operator_test.go @@ -6,6 +6,7 @@ import ( ) func TestOperatorCommand_noTabs(t *testing.T) { + t.Parallel() if strings.ContainsRune(New().Help(), '\t') { t.Fatal("help has tabs") } diff --git a/command/operator/raft/listpeers/operator_raft_list_test.go b/command/operator/raft/listpeers/operator_raft_list_test.go index ab302d980f..dcf1f7b5e1 100644 --- a/command/operator/raft/listpeers/operator_raft_list_test.go +++ b/command/operator/raft/listpeers/operator_raft_list_test.go @@ -10,12 +10,14 @@ import ( ) func TestOperatorRaftListPeersCommand_noTabs(t *testing.T) { + t.Parallel() if strings.ContainsRune(New(cli.NewMockUi()).Help(), '\t') { t.Fatal("help has tabs") } } func TestOperatorRaftListPeersCommand(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() diff --git a/command/operator/raft/operator_raft_test.go b/command/operator/raft/operator_raft_test.go index ddc33ea969..2ede9936ef 100644 --- a/command/operator/raft/operator_raft_test.go +++ b/command/operator/raft/operator_raft_test.go @@ -6,6 +6,7 @@ import ( ) func TestOperatorRaftCommand_noTabs(t *testing.T) { + t.Parallel() if strings.ContainsRune(New().Help(), '\t') { t.Fatal("help has tabs") } diff --git a/command/operator/raft/removepeer/operator_raft_remove_test.go b/command/operator/raft/removepeer/operator_raft_remove_test.go index c7ba1245aa..e18fadd720 100644 --- a/command/operator/raft/removepeer/operator_raft_remove_test.go +++ b/command/operator/raft/removepeer/operator_raft_remove_test.go @@ -9,12 +9,14 @@ import ( ) func TestOperatorRaftRemovePeerCommand_noTabs(t *testing.T) { + t.Parallel() if strings.ContainsRune(New(cli.NewMockUi()).Help(), '\t') { t.Fatal("help has tabs") } } func TestOperatorRaftRemovePeerCommand(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() diff --git a/command/reload/reload_test.go b/command/reload/reload_test.go index efed6eb938..dc9f612bb8 100644 --- a/command/reload/reload_test.go +++ b/command/reload/reload_test.go @@ -9,12 +9,14 @@ import ( ) func TestReloadCommand_noTabs(t *testing.T) { + t.Parallel() if strings.ContainsRune(New(cli.NewMockUi()).Help(), '\t') { t.Fatal("help has tabs") } } func TestReloadCommand(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() diff --git a/command/rtt/rtt_test.go b/command/rtt/rtt_test.go index 0b861cd11f..120ce0378c 100644 --- a/command/rtt/rtt_test.go +++ b/command/rtt/rtt_test.go @@ -13,12 +13,14 @@ import ( ) func TestRTTCommand_noTabs(t *testing.T) { + t.Parallel() if strings.ContainsRune(New(cli.NewMockUi()).Help(), '\t') { t.Fatal("help has tabs") } } func TestRTTCommand_BadArgs(t *testing.T) { + t.Parallel() tests := []struct { args []string }{ @@ -41,6 +43,7 @@ func TestRTTCommand_BadArgs(t *testing.T) { } func TestRTTCommand_LAN(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ` consul = { coordinate = { @@ -148,6 +151,7 @@ func TestRTTCommand_LAN(t *testing.T) { } func TestRTTCommand_WAN(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() diff --git a/command/snapshot/inspect/snapshot_inspect_test.go b/command/snapshot/inspect/snapshot_inspect_test.go index 1e50f36145..8b43beffd5 100644 --- a/command/snapshot/inspect/snapshot_inspect_test.go +++ b/command/snapshot/inspect/snapshot_inspect_test.go @@ -13,12 +13,14 @@ import ( ) func TestSnapshotInpectCommand_noTabs(t *testing.T) { + t.Parallel() if strings.ContainsRune(New(cli.NewMockUi()).Help(), '\t') { t.Fatal("help has tabs") } } func TestSnapshotInspectCommand_Validation(t *testing.T) { + t.Parallel() ui := cli.NewMockUi() c := New(ui) @@ -58,6 +60,7 @@ func TestSnapshotInspectCommand_Validation(t *testing.T) { } func TestSnapshotInspectCommand(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() client := a.Client() diff --git a/command/snapshot/restore/snapshot_restore_test.go b/command/snapshot/restore/snapshot_restore_test.go index 198b989a84..319e639564 100644 --- a/command/snapshot/restore/snapshot_restore_test.go +++ b/command/snapshot/restore/snapshot_restore_test.go @@ -13,12 +13,14 @@ import ( ) func TestSnapshotRestoreCommand_noTabs(t *testing.T) { + t.Parallel() if strings.ContainsRune(New(cli.NewMockUi()).Help(), '\t') { t.Fatal("help has tabs") } } func TestSnapshotRestoreCommand_Validation(t *testing.T) { + t.Parallel() ui := cli.NewMockUi() c := New(ui) @@ -58,6 +60,7 @@ func TestSnapshotRestoreCommand_Validation(t *testing.T) { } func TestSnapshotRestoreCommand(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() client := a.Client() diff --git a/command/snapshot/save/snapshot_save_test.go b/command/snapshot/save/snapshot_save_test.go index 728ca90d6f..446d85dd19 100644 --- a/command/snapshot/save/snapshot_save_test.go +++ b/command/snapshot/save/snapshot_save_test.go @@ -12,11 +12,13 @@ import ( ) func TestSnapshotSaveCommand_noTabs(t *testing.T) { + t.Parallel() if strings.ContainsRune(New(cli.NewMockUi()).Help(), '\t') { t.Fatal("help has tabs") } } func TestSnapshotSaveCommand_Validation(t *testing.T) { + t.Parallel() cases := map[string]struct { args []string @@ -57,6 +59,7 @@ func TestSnapshotSaveCommand_Validation(t *testing.T) { } func TestSnapshotSaveCommand(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown() client := a.Client() diff --git a/command/snapshot/snapshot_command_test.go b/command/snapshot/snapshot_command_test.go index 755d35aeaf..5ac6236bc6 100644 --- a/command/snapshot/snapshot_command_test.go +++ b/command/snapshot/snapshot_command_test.go @@ -6,6 +6,7 @@ import ( ) func TestSnapshotCommand_noTabs(t *testing.T) { + t.Parallel() if strings.ContainsRune(New().Help(), '\t') { t.Fatal("help has tabs") } diff --git a/command/validate/validate_test.go b/command/validate/validate_test.go index 5d3f7217c3..517e02b620 100644 --- a/command/validate/validate_test.go +++ b/command/validate/validate_test.go @@ -12,12 +12,14 @@ import ( ) func TestValidateCommand_noTabs(t *testing.T) { + t.Parallel() if strings.ContainsRune(New(nil).Help(), '\t') { t.Fatal("help has tabs") } } func TestValidateCommand_FailOnEmptyFile(t *testing.T) { + t.Parallel() tmpFile := testutil.TempFile(t, "consul") defer os.RemoveAll(tmpFile.Name()) @@ -30,6 +32,7 @@ func TestValidateCommand_FailOnEmptyFile(t *testing.T) { } func TestValidateCommand_SucceedOnMinimalConfigFile(t *testing.T) { + t.Parallel() td := testutil.TempDir(t, "consul") defer os.RemoveAll(td) @@ -48,6 +51,7 @@ func TestValidateCommand_SucceedOnMinimalConfigFile(t *testing.T) { } func TestValidateCommand_SucceedOnMinimalConfigDir(t *testing.T) { + t.Parallel() td := testutil.TempDir(t, "consul") defer os.RemoveAll(td) @@ -65,6 +69,7 @@ func TestValidateCommand_SucceedOnMinimalConfigDir(t *testing.T) { } func TestValidateCommand_Quiet(t *testing.T) { + t.Parallel() td := testutil.TempDir(t, "consul") defer os.RemoveAll(td) diff --git a/command/version/version_test.go b/command/version/version_test.go index 0d80db4e19..4cfdf4fde7 100644 --- a/command/version/version_test.go +++ b/command/version/version_test.go @@ -8,6 +8,7 @@ import ( ) func TestVersionCommand_noTabs(t *testing.T) { + t.Parallel() if strings.ContainsRune(New(cli.NewMockUi(), "").Help(), '\t') { t.Fatal("help has tabs") } diff --git a/command/watch/watch_test.go b/command/watch/watch_test.go index 4c48845120..153377f654 100644 --- a/command/watch/watch_test.go +++ b/command/watch/watch_test.go @@ -9,12 +9,14 @@ import ( ) func TestWatchCommand_noTabs(t *testing.T) { + t.Parallel() if strings.ContainsRune(New(cli.NewMockUi(), nil).Help(), '\t') { t.Fatal("help has tabs") } } func TestWatchCommand(t *testing.T) { + t.Parallel() a := agent.NewTestAgent(t.Name(), ``) defer a.Shutdown()