From b29da3746264f42ffad540c2981c148a22bb9deb Mon Sep 17 00:00:00 2001 From: Andrew Wood Date: Sat, 6 Jun 2026 19:57:39 +0100 Subject: [PATCH] Use a maximum of 3/4 of the space in the temporary directory, to avoid the "quota exceeded" errors on /dev/shm seen on some OSes during testing. --- docs/benchmark-pv-transfers.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/benchmark-pv-transfers.sh b/docs/benchmark-pv-transfers.sh index 5c4ec19..fc40573 100755 --- a/docs/benchmark-pv-transfers.sh +++ b/docs/benchmark-pv-transfers.sh @@ -223,9 +223,11 @@ runBenchmarks () { pv="$1" restrictTo="$2" - # Check there's enough room for the test files - make them smaller, - # if not. - tmpSpaceMB="$(df -kP "${TMPDIR:-/tmp}" | awk 'FNR==2 {print int($4/1024)}')" + # Check there's enough room for the test files, meaning that 2 test + # files + 1 output file + 2MB doesn't add up to more than 75% of the + # space on the filesystem holding TMPDIR - make the test files + # smaller, if not. + tmpSpaceMB="$(df -kP "${TMPDIR:-/tmp}" | awk 'FNR==2 {print int($4*3/4096)}')" while test "${testFileMB}" -gt 4; do test "${tmpSpaceMB}" -gt $((2+3*testFileMB)) && break testFileMB=$((testFileMB/2))