From 7f7d0396dd4b0c9e1f2b6a8eddfdb8afe561a93d Mon Sep 17 00:00:00 2001 From: Tino Reichardt Date: Thu, 3 Oct 2024 20:42:25 +0200 Subject: [PATCH] ZTS: Fix summary page creation There are cases, where some needed files for the summary page aren't created. Currently the whole Summary Page creation will fail then. Sample run: https://github.com/openzfs/zfs/actions/runs/11148248072/job/30999748588 Fix this, by properly checking for existence of the needed files. Reviewed-by: Tony Hutter Reviewed-by: Brian Behlendorf Reviewed-by: Rob Norris Signed-off-by: Tino Reichardt Closes #16599 --- .github/workflows/scripts/qemu-6-tests.sh | 31 ++++++++++++++++++- .../workflows/scripts/qemu-9-summary-page.sh | 2 ++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/.github/workflows/scripts/qemu-6-tests.sh b/.github/workflows/scripts/qemu-6-tests.sh index 2f023198bbf6..0d6a81765f89 100755 --- a/.github/workflows/scripts/qemu-6-tests.sh +++ b/.github/workflows/scripts/qemu-6-tests.sh @@ -85,15 +85,44 @@ case "$1" in sudo mv -f /tmp/*.txt /var/tmp sudo -E modprobe zfs TDIR="/usr/share/zfs" + + # Enable swap to mitigate some OOM conditions like: + # https://github.com/openzfs/zfs/issues/16566 + # + # Directions for setting up swap on btrfs (Fedora) from: + # https://btrfs.readthedocs.io/en/latest/Swapfile.html + echo "setting up swap" + if ! sudo truncate -s 0 /swapfile &> /dev/null ; then + echo "truncate failed" + fi + + if ! sudo chattr +C /swapfile &> /dev/null ; then + echo "chattr failed" + fi + + if ! sudo fallocate -l 16G /swapfile &> /dev/null ; then + echo "fallocate failed" + fi + if ! sudo chmod 0600 /swapfile &> /dev/null ; then + echo "chmod failed" + fi + if ! sudo mkswap /swapfile &> /dev/null ; then + echo "mkswap failed" + fi + + if ! sudo swapon /swapfile &> /dev/null ; then + echo "Swapon failed" + fi ;; esac # run functional testings and save exitcode cd /var/tmp -TAGS=$2/$3 +# TAGS=$2/$3 if [ "$4" == "quick" ]; then export RUNFILES="sanity.run" fi +TAGS=raidz sudo dmesg -c > dmesg-prerun.txt mount > mount.txt df -h > df-prerun.txt diff --git a/.github/workflows/scripts/qemu-9-summary-page.sh b/.github/workflows/scripts/qemu-9-summary-page.sh index 2f4c21f9910a..cae287ac1073 100755 --- a/.github/workflows/scripts/qemu-9-summary-page.sh +++ b/.github/workflows/scripts/qemu-9-summary-page.sh @@ -11,10 +11,12 @@ function output() { } function outfile() { + test -s "$1" || return cat "$1" >> "out-$logfile.md" } function outfile_plain() { + test -s "$1" || return output "
"
   cat "$1" >> "out-$logfile.md"
   output "
"