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

integration: Wait until test-pod was OOMKilled for oomkill related tests #2649

Merged
merged 1 commit into from
Mar 27, 2024

Conversation

eiffel-fl
Copy link
Member

No description provided.

Copy link
Member

@alban alban left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not tested but the code looks good to me.
Feel free to merge if all the tests are green.

Comment on lines 96 to 99
if *k8sDistro == K8sDistroAKSUbuntu {
waitCommand = WaitUntilTestPodOOMKilledCommand(ns)
} else {
waitCommand = WaitUntilTestPodReadyCommand(ns)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the difference of behaviour really about the distribution?

If the container is slow to get oomkilled, we should be able to detect the pod be condition=ready and then oomkilled. If the container gets oomkilled fast, the pod status might go to oomkilled fast enough so we don't see the condition=ready.

It seems to me we should wait for the condition "ready or oomkilled" to avoid the race condition, if possible.

Copy link
Member Author

@eiffel-fl eiffel-fl Mar 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the difference of behaviour really about the distribution?

So far, the tests are failing on AKS Ubuntu.

If the container is slow to get oomkilled, we should be able to detect the pod be condition=ready and then oomkilled. If the container gets oomkilled fast, the pod status might go to oomkilled fast enough so we don't see the condition=ready.

It seems to me we should wait for the condition "ready or oomkilled" to avoid the race condition, if possible.

I am still understanding how to fix everything here.
Particularly, I am not even sure we would get event generated in this case (i.e. OOMKilled on AKS Ubuntu), so I may just end up with skipping the test here ¯\(ツ)/¯.

More specifically, the pod never reaches this state on other distribution, because it is only tail which is killed and not the pod itself.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, so with using sleep I was able to have the CI passed at one time:
https://github.com/inspektor-gadget/inspektor-gadget/actions/runs/8452074988
I will try with the approach to wait for ready or OOM killed, but I do not like the idea to have to run the CI up to 6 times to have it pass.

…l tests.

Signed-off-by: Francis Laniel <flaniel@linux.microsoft.com>
@eiffel-fl eiffel-fl force-pushed the citest/francis/integration-oomkill-wait-killed branch from 5bff79d to 3ff5a59 Compare March 27, 2024 11:49
@eiffel-fl eiffel-fl force-pushed the citest/francis/integration-oomkill-wait-killed branch from 080170c to 3ff5a59 Compare March 27, 2024 15:22
@eiffel-fl
Copy link
Member Author

I will merge it as is.
Nonetheless this is still flaky: if the pod was OOM killed, maybe the event was caught or not, hence the flakyness.
A workaround would be to skip the test if the pod was OOM killed, but this would need to modify heavily these tests, so I will think about.

@eiffel-fl
Copy link
Member Author

Thank you for the review!

@eiffel-fl eiffel-fl merged commit 73b31fe into main Mar 27, 2024
239 of 244 checks passed
@eiffel-fl eiffel-fl deleted the citest/francis/integration-oomkill-wait-killed branch March 27, 2024 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants