From fcc9ee6542f3c6f60ab2e7d3ce18f6f78f1e8371 Mon Sep 17 00:00:00 2001 From: "Chris S. Kim" Date: Fri, 20 Oct 2023 10:13:57 -0400 Subject: [PATCH] Rename tests --- agent/connect/ca/provider_vault_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/agent/connect/ca/provider_vault_test.go b/agent/connect/ca/provider_vault_test.go index ae862b0452..edd094f550 100644 --- a/agent/connect/ca/provider_vault_test.go +++ b/agent/connect/ca/provider_vault_test.go @@ -241,7 +241,7 @@ func TestVaultCAProvider_Configure(t *testing.T) { } // This test must not run in parallel -func TestVaultCAProvider_ConfigureWithBadToken(t *testing.T) { +func TestVaultCAProvider_ConfigureFailureGoroutineLeakCheck(t *testing.T) { if testing.Short() { t.Skip("too slow for testing.Short") } @@ -258,7 +258,7 @@ func TestVaultCAProvider_ConfigureWithBadToken(t *testing.T) { provider := NewVaultProvider(hclog.New(&hclog.LoggerOptions{Name: "ca.vault"})) - t.Run("bad token does not leak renewal routine on Configure", func(t *testing.T) { + t.Run("error on Configure does not leak renewal routine", func(t *testing.T) { config := map[string]any{ "RootPKIPath": "pki-root/", "IntermediatePKIPath": "badbadbad/", @@ -282,7 +282,7 @@ func TestVaultCAProvider_ConfigureWithBadToken(t *testing.T) { }) }) - t.Run("correct token starts renewal routine", func(t *testing.T) { + t.Run("successful Configure starts renewal routine", func(t *testing.T) { config := map[string]any{ "RootPKIPath": "pki-root/", "IntermediatePKIPath": "pki-intermediate/", @@ -295,6 +295,7 @@ func TestVaultCAProvider_ConfigureWithBadToken(t *testing.T) { profile := pprof.Lookup("goroutine") sb := strings.Builder{} require.NoError(r, profile.WriteTo(&sb, 2)) + t.Log(sb.String()) require.Contains(r, sb.String(), "created by github.com/hashicorp/consul/agent/connect/ca.(*VaultProvider).Configure", "expected renewal goroutine, got none")