Skip to content

Commit

Permalink
Rename tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris S. Kim committed Oct 20, 2023
1 parent cb7e5de commit fcc9ee6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions agent/connect/ca/provider_vault_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand All @@ -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/",
Expand All @@ -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/",
Expand All @@ -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")
Expand Down

0 comments on commit fcc9ee6

Please sign in to comment.