Skip to content

Commit d5709db

Browse files
Fix flaky diagnostics redaction integration test (#7414) (#7480)
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 <[email protected]>
1 parent 2a3710c commit d5709db

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

testing/integration/diagnostics_test.go

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

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

0 commit comments

Comments
 (0)