From 874af15996c67abe839e19f8d8aad59db67636db Mon Sep 17 00:00:00 2001 From: Paolo Chila Date: Mon, 25 Sep 2023 15:49:58 +0200 Subject: [PATCH] fixup! TEST commit - fix testInstallWithEndpointSecurityAndRemoveEndpointIntegration assertion --- testing/integration/endpoint_security_test.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/testing/integration/endpoint_security_test.go b/testing/integration/endpoint_security_test.go index ff6f2f9da96..83390d274ae 100644 --- a/testing/integration/endpoint_security_test.go +++ b/testing/integration/endpoint_security_test.go @@ -12,6 +12,7 @@ import ( _ "embed" "encoding/json" "fmt" + "io/fs" "os" "path/filepath" "strings" @@ -395,7 +396,7 @@ func testInstallWithEndpointSecurityAndRemoveEndpointIntegration(t *testing.T, i // Regression test for https://github.com/elastic/elastic-agent/issues/3077 agentInstallPath := fixture.WorkDir() agentInstallParentDir := filepath.Join(agentInstallPath, "..") - require.Eventually(t, func() bool { + assert.Eventually(t, func() bool { t.Logf("Checking directories at install path %s", agentInstallParentDir) files, listInstallPathErr := os.ReadDir(filepath.Clean(agentInstallParentDir)) if err != nil { @@ -416,6 +417,16 @@ func testInstallWithEndpointSecurityAndRemoveEndpointIntegration(t *testing.T, i t.Logf("Check of install path directory successful") return true }, time.Minute, time.Second, "Endpoint directory was not removed") + + if t.Failed() { + // list all the contents of install parent dir + Endpoint + endpointPath := filepath.Join(agentInstallParentDir, "Endpoint") + t.Logf("Dumping content of %q", endpointPath) + filepath.WalkDir(endpointPath, func(path string, d fs.DirEntry, err error) error { + t.Logf("%q - %v", path, d) + return err + }) + } } // This is a subset of kibana.AgentPolicyUpdateRequest, using until elastic-agent-libs PR https://github.com/elastic/elastic-agent-libs/pull/141 is merged