Merge pull request #1054 from mrunalp/oom_test_loop
test: Test for OOM condition in a loop
This commit is contained in:
commit
26ca82b23d
1 changed files with 10 additions and 4 deletions
|
@ -767,10 +767,16 @@ function teardown() {
|
|||
echo "$output"
|
||||
[ "$status" -eq 0 ]
|
||||
# Wait for container to OOM
|
||||
sleep 100
|
||||
run crioctl ctr status --id "$ctr_id"
|
||||
echo "$output"
|
||||
[ "$status" -eq 0 ]
|
||||
attempt=0
|
||||
while [ $attempt -le 100 ]; do
|
||||
attempt=$((attempt+1))
|
||||
run crioctl ctr status --id "$ctr_id"
|
||||
echo "$output"
|
||||
if [[ "$output" =~ "OOMKilled" ]]; then
|
||||
break
|
||||
fi
|
||||
sleep 10
|
||||
done
|
||||
[[ "$output" =~ "OOMKilled" ]]
|
||||
run crioctl pod stop --id "$pod_id"
|
||||
echo "$output"
|
||||
|
|
Loading…
Reference in a new issue