Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

policyfiletr K8s test fix #2629

Merged
merged 3 commits into from
Jul 5, 2024
Merged

policyfiletr K8s test fix #2629

merged 3 commits into from
Jul 5, 2024

Conversation

kkourt
Copy link
Contributor

@kkourt kkourt commented Jul 4, 2024

I've noticed a flake in the pkg.policyfilter.TestK8s

The test uses a fake k8s clientset, applies changes (e.g., adding or
removing pods), and then checks whether the policyfilter bpf map has the
expected contents.

We need to check the state after the pod informer callbacks have be
called. To do so, we maintain an operation count. We check that all
operations have been completed and then compare the contents of the
policyfilter map.

We seem to be increasing the counter first and then calling the
callback, however, which means that there is a small race where the
counts match but the bpf map contents have not been updated.

This patch increases the counters after the callback returns.

This seems to fix the issue in my local machine.

Also, two more minor updates.

Fixes: #2470

kkourt added 3 commits July 4, 2024 16:10
I've noticed a flake in the pkg.policyfilter.TestK8s

The test uses a fake k8s clientset, applies changes (e.g., adding or
removing pods), and then checks whether the policyfilter bpf map has the
expected contents.

We need to check the state after the pod informer callbacks have be
called. To do so, we maintain an operation count. We check that all
operations have been completed and then compare the contents of the
policyfilter map.

We seem to be increasing the counter first and then calling the
callback, however, which means that there is a small race where the
counts match but the bpf map contents have not been updated.

This patch increases the counters after the callback returns.

This seems to fix the issue in my local machine.

Signed-off-by: Kornilios Kourtis <[email protected]>
The vmtests README uses outdated images. Update to the proper images.

Signed-off-by: Kornilios Kourtis <[email protected]>
@kkourt kkourt added area/ci Related to CI release-note/ci This PR makes changes to the CI. labels Jul 4, 2024
@kkourt kkourt requested a review from a team as a code owner July 4, 2024 14:12
@kkourt kkourt requested a review from tpapagian July 4, 2024 14:12
@kkourt kkourt merged commit 85842ad into main Jul 5, 2024
42 checks passed
@kkourt kkourt deleted the pr/kkourt/policyfilter-k8s-ci-fix branch July 5, 2024 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ci Related to CI release-note/ci This PR makes changes to the CI.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

policyfilter test failure on bpf-next
2 participants