From 5772e81ae8f20da3bd6c822cc0ca2576d67ec92a Mon Sep 17 00:00:00 2001 From: hc-github-team-secure-vault-core <82990506+hc-github-team-secure-vault-core@users.noreply.github.com> Date: Mon, 10 Jul 2023 09:55:55 -0400 Subject: [PATCH] backport of commit e29842e49e807b574dccb8e87bc20947a6d21438 (#21712) Co-authored-by: Steven Clark --- builtin/logical/pki/path_tidy_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/builtin/logical/pki/path_tidy_test.go b/builtin/logical/pki/path_tidy_test.go index a5469ce00..a276aeca3 100644 --- a/builtin/logical/pki/path_tidy_test.go +++ b/builtin/logical/pki/path_tidy_test.go @@ -496,6 +496,7 @@ func TestCertStorageMetrics(t *testing.T) { } cluster := vault.NewTestCluster(t, coreConfig, &vault.TestClusterOptions{ HandlerFunc: vaulthttp.Handler, + NumCores: 1, }) cluster.Start() defer cluster.Cleanup() @@ -577,9 +578,9 @@ func TestCertStorageMetrics(t *testing.T) { require.NoError(t, err) // Reload the Mount - Otherwise Stored Certificate Counts Will Not Be Populated - _, err = client.Logical().Write("/sys/plugins/reload/backend", map[string]interface{}{ - "plugin": "pki", - }) + // Sealing cores as plugin reload triggers the race detector - VAULT-13635 + testhelpers.EnsureCoresSealed(t, cluster) + testhelpers.EnsureCoresUnsealed(t, cluster) // By reading the auto-tidy endpoint, we ensure that initialize has completed (which has a write lock on auto-tidy) _, err = client.Logical().Read("/pki/config/auto-tidy")