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

e2e: fix topology-aware/n4c16/test09-container-exit test #1050

Merged
merged 1 commit into from Aug 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -8,7 +8,13 @@ pyexec 'assert "pod0c0" in allocations'

out '### Crash and restart pod0c0'
vm-command "kubectl get pods pod0"
vm-command "kill -KILL \$(pgrep -f pod0c0)"

vm-command "set -x; [[ -n \"\$(pgrep -f pod0c0)\" ]] && [[ \"\$(pgrep -f pod0c0 --oldest)\" != \"\$(pgrep -f pod0c0 --newest)\" ]]" || {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is that set -x needed/wanted or just a debugging leftover ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

set -x is there by purpose. Similarly to "kubectl get pods pod0" above, it is not strictly necessary but helps figuring out pids in the system from the test output, should the test fail again in the future.

command-error "There must be separate parent and child 'pod0c0' processes in order to run this test"
}

out '### Kill the root process in pod0c0. The container should get Restarted.'
vm-command "kill -KILL \$(pgrep -f pod0c0 --oldest)"
sleep 2
vm-command 'kubectl wait --for=condition=Ready pods/pod0'
vm-run-until --timeout 30 "pgrep -f pod0c0 > /dev/null 2>&1"
Expand All @@ -17,10 +23,10 @@ report allowed
verify 'len(cpus["pod0c0"]) == 1'
pyexec 'assert "pod0c0" in allocations'

out '### Exit and complete pod0c0 by killing "sleep inf"'
out '### => sh (the init process in the container) will exit with status 0'
out '### Kill the child process in pod0c0. The root process exits with status 0, the container should get Completed.'
vm-command "kubectl get pods pod0"
vm-command "kill -KILL \$(pgrep --parent \$(pgrep -f pod0c0) sleep)"
vm-command "ps axf | grep pod0c0; echo newest: \$(pgrep -f pod0c0 --newest)"
vm-command "kill -KILL \$(pgrep -f pod0c0 --newest)"
sleep 2
vm-command "kubectl get pods pod0"
# pod0c0 process is not on vm anymore
Expand Down