diff --git a/tests/integration/event_filters_test.go b/tests/integration/event_filters_test.go index d47f1522df71..420fa1f24131 100644 --- a/tests/integration/event_filters_test.go +++ b/tests/integration/event_filters_test.go @@ -2469,8 +2469,9 @@ func ExpectAllInOrderSequentially(t *testing.T, cmdEvents []cmdEvents, actual *e actEvtsCopy := actual.getCopy() + actEvtIdx := 0 // second stage: check events - for cmdIdx, cmd := range cmdEvents { + for _, cmd := range cmdEvents { syscallsInSets := []string{} checkSets := len(cmd.sets) > 0 if checkSets { @@ -2478,8 +2479,9 @@ func ExpectAllInOrderSequentially(t *testing.T, cmdEvents []cmdEvents, actual *e } // compare the expected events with the actual events in the same order - for evtIdx, expEvt := range cmd.expectedEvents { - actEvt := actEvtsCopy[cmdIdx*len(cmd.expectedEvents)+evtIdx] + for _, expEvt := range cmd.expectedEvents { + actEvt := actEvtsCopy[actEvtIdx] + actEvtIdx++ if checkSets && !isInSets(actEvt.EventName, syscallsInSets) { return fmt.Errorf("Event %s not found in sets %v", actEvt.EventName, cmd.sets)