Skip to content

test: fix flakiness in TestKprobeMatchParentBinaries#4828

Open
ethical-buddy wants to merge 2 commits into
cilium:mainfrom
ethical-buddy:main
Open

test: fix flakiness in TestKprobeMatchParentBinaries#4828
ethical-buddy wants to merge 2 commits into
cilium:mainfrom
ethical-buddy:main

Conversation

@ethical-buddy
Copy link
Copy Markdown

@ethical-buddy ethical-buddy commented Apr 7, 2026

Fixes

Description

TestKprobeMatchParentBinaries was asserting on the exported ProcessKprobe.Parent binary, but that
is not the field used by the matchParentBinaries selector in the exec-without-clone path.

For same-process execs, the selector matches against the previous binary stored in tg_parents_bin,
while the exported Parent field is resolved separately from the real parent process. That made the
test validate the wrong observable and could fail even when selector behavior was correct.

This change keeps the test intent but makes the assertion direct and deterministic:

  • run one matching shell and one non-matching shell against different files
  • assert that the expected fd_install event is emitted for the matching case
  • assert that no corresponding event is emitted for the non-matching case

It also restores option.Config.ParentsMapEnabled with cleanup to avoid leaking global test state.

Changelog

  pkg/sensors/tracing: fix `TestKprobeMatchParentBinaries` to assert selector behavior directly 

@ethical-buddy ethical-buddy requested a review from a team as a code owner April 7, 2026 10:13
@olsajiri olsajiri self-requested a review April 7, 2026 11:39
@FedeDP
Copy link
Copy Markdown
Contributor

FedeDP commented Apr 9, 2026

Ehy thanks for this PR!
It seems like the modified tests are now failing in CI; can you please take a look?

@kkourt kkourt added the release-note/ci This PR makes changes to the CI. label Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note/ci This PR makes changes to the CI.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants