Skip to content

Commit 378c3e8

Browse files
Fix flaky diagnostics redaction integration test (#7414) (#7482)
The test expects to see a particular input from a fleet policy in diagnostic output, but doesn't wait until the policy is actually applied. (cherry picked from commit 8af1feb) Co-authored-by: Mikołaj Świątek <mail@mikolajswiatek.com>
1 parent c88e1d1 commit 378c3e8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

testing/integration/diagnostics_test.go

+5
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,11 @@ func TestRedactFleetSecretPathsDiagnostics(t *testing.T) {
257257
require.NoErrorf(t, err, "Error when installing agent, output: %s", out)
258258
check.ConnectedToFleet(ctx, t, fixture, 5*time.Minute)
259259

260+
// wait until the agent acknowledges the policy change
261+
require.Eventually(t, func() bool {
262+
return checkinWithAcker.Acked(policyChangeAction.ActionID)
263+
}, time.Minute, time.Second)
264+
260265
t.Log("Gather diagnostics.")
261266
diagZip, err := fixture.ExecDiagnostics(ctx)
262267
require.NoError(t, err, "error when gathering diagnostics")

0 commit comments

Comments
 (0)