Skip to content

Commit 224a485

Browse files
Fix flaky diagnostics redaction integration test (#7414) (#7485)
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 ece95ba commit 224a485

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
@@ -259,6 +259,11 @@ func TestRedactFleetSecretPathsDiagnostics(t *testing.T) {
259259
require.NoErrorf(t, err, "Error when installing agent, output: %s", out)
260260
check.ConnectedToFleet(ctx, t, fixture, 5*time.Minute)
261261

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

0 commit comments

Comments
 (0)