From 7b3dfbc951362ab763783dd1a83212f7324b768f Mon Sep 17 00:00:00 2001 From: David Elie-Dit-Cosaque <86730676+edcdavid@users.noreply.github.com> Date: Wed, 8 Nov 2023 14:30:04 -0600 Subject: [PATCH] Fix regression in performance-rt-apps-no-exec-probes (#1593) * Fix regression * Addressing comments from David R. --- cnf-certification-test/performance/suite.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/cnf-certification-test/performance/suite.go b/cnf-certification-test/performance/suite.go index fad47e3d1..ce5bf652f 100644 --- a/cnf-certification-test/performance/suite.go +++ b/cnf-certification-test/performance/suite.go @@ -18,6 +18,7 @@ package performance import ( "fmt" + "slices" "strconv" "strings" @@ -325,13 +326,11 @@ func filterProbeProcesses(allProcesses []*crclient.Process, cut *provider.Contai } // remove all exec probes and their children from the process list for _, p := range allProcesses { - for _, parentProbePid := range execProbeProcesses { - if p.Pid == parentProbePid || p.PPid == parentProbePid { - // skip exec probe processes (child or parent) - continue - } - notExecProbeProcesses = append(notExecProbeProcesses, p) + if slices.Contains(execProbeProcesses, p.Pid) || slices.Contains(execProbeProcesses, p.PPid) { + // this process is part of an exec probe (child or parent), continue + continue } + notExecProbeProcesses = append(notExecProbeProcesses, p) } return notExecProbeProcesses, compliantObjects }