From f65d548ac2e981230bdf0e94e86336d49b283b1a Mon Sep 17 00:00:00 2001 From: Chris Evich Date: Tue, 29 Aug 2017 15:53:10 -0400 Subject: [PATCH] Add file-backed swap to prevent OOM Without any swap space enabled, it's possible some intensive operation can chew up all the memory on the test VM. Enabling swap space will prevent this for minor cases, but could lead to disk-thrashing if the memory demand is excessive. Since the test system never reboots, using a file-backed swap should suffice. Though not ideal, it's easy to setup and doesn't require any interactions with the cloud that owns the VM or the job that created it. Signed-off-by: Chris Evich --- contrib/test/crio-integration-playbook.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/contrib/test/crio-integration-playbook.yaml b/contrib/test/crio-integration-playbook.yaml index 0ad67aa4..35b9e003 100644 --- a/contrib/test/crio-integration-playbook.yaml +++ b/contrib/test/crio-integration-playbook.yaml @@ -76,6 +76,13 @@ async: 600 poll: 10 when: ansible_distribution == 'Fedora' + - name: Setup swap to prevent kernel firing off the OOM killer + shell: | + truncate -s 8G /root/swap && \ + export SWAPDEV=$(losetup --show -f /root/swap | head -1) && \ + mkswap $SWAPDEV && \ + swapon $SWAPDEV && \ + swapon --show - name: Make testing directories to conform to testing standards file: path: "{{ item }}"