Skip to content

Commit

Permalink
Fix OOMKilled test
Browse files Browse the repository at this point in the history
Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
  • Loading branch information
saschagrunert committed Aug 2, 2024
1 parent 4eaec8d commit 6d9f3a1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
23 changes: 14 additions & 9 deletions .github/workflows/crio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,27 +93,32 @@ jobs:
ARGS=(--ginkgo.skip 'SupplementalGroups|AppArmor|RunAsUser')
fi
set +o errexit
sudo -E PATH=$PATH critest \
--runtime-endpoint=unix:///var/run/crio/crio.sock \
--parallel=$(nproc) \
--ginkgo.flake-attempts=3 \
--ginkgo.randomize-all \
--ginkgo.timeout=2m \
--ginkgo.trace \
--ginkgo.vv \
--ginkgo.focus 'should terminate with exitCode 137 and reason OOMKilled' \
"${ARGS[@]}"
TEST_RC=$?
set -o errexit
test $TEST_RC -ne 0 && sudo journalctl --no-pager
exit $TEST_RC
- name: Run crictl e2e tests
if: ${{matrix.suite == 'e2e'}}
shell: bash
run: |
set -euox pipefail
set +o errexit
sudo -E PATH=$PATH make test-e2e \
TESTFLAGS="-crictl-runtime-endpoint=unix://var/run/crio/crio.sock"
TEST_RC=$?
set -o errexit
- name: Collect CRI-O logs
run: sudo journalctl -u crio > cri-o.log

- name: Upload CRI-O logs
uses: actions/upload-artifact@v4
with:
name: cri-o-${{matrix.suite}}-${{matrix.oci-runtime}}-${{matrix.monitor}}-${{github.sha}}.log
path: cri-o.log
test $TEST_RC -ne 0 && sudo journalctl --no-pager
exit $TEST_RC
6 changes: 2 additions & 4 deletions pkg/validate/container_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,10 @@ var _ = framework.KubeDescribe("Container OOM", func() {
state := getContainerStatus(rc, containerID)

By("exit code is 137")
//nolint:ginkgolinter // This cannot be fixed right now since it introduces a behavioral change. See: https://github.com/cri-o/cri-o/issues/8411
Expect(state.ExitCode, int32(137))
Expect(state.ExitCode).To(BeEquivalentTo(137))

By("reason is OOMKilled")
//nolint:ginkgolinter // This cannot be fixed right now since it introduces a behavioral change. See: https://github.com/cri-o/cri-o/issues/8411
Expect(state.Reason, "OOMKilled")
Expect(state.Reason).To(Equal("OOMKilled"))
})
})
})
Expand Down

0 comments on commit 6d9f3a1

Please sign in to comment.