Skip to content

Commit 906dcff

Browse files
JustinKuliopenshift-ci[bot]
authored andcommitted
Fix test assertion for duplicate events
The test is meant to ensure that the gatekeeper-sync is not emitting the same event multiple times in a row. But the assertion was failing sometimes because of duplicate events from template-errors. Those will sometimes occur during normal (correct) operation of the template-sync. Signed-off-by: Justin Kulikauskas <[email protected]>
1 parent 0034b03 commit 906dcff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/e2e/case17_gatekeeper_sync_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,9 @@ var _ = Describe("Test Gatekeeper ConstraintTemplate and constraint sync", Order
297297
fmt.Sprintf("Got %s but expected one of %v", history[0].Message, validMsgs),
298298
)
299299

300-
// Verify that there are no duplicate status messages.
300+
// Verify that there are no duplicate gatekeeper status messages.
301301
for i, historyEvent := range managedPolicy.Status.Details[1].History {
302-
if i == 0 || strings.HasPrefix(historyEvent.Message, "NonCompliant; template-error;") {
302+
if i == 0 || strings.Contains(historyEvent.Message, "NonCompliant; template-error;") {
303303
continue
304304
}
305305

0 commit comments

Comments
 (0)