From: Darrick J. Wong Date: Tue, 26 Feb 2019 02:35:29 +0000 (-0800) Subject: fstests: don't oom the box opening tmpfiles X-Git-Tag: v2022.05.01~1241 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=dd2c726684ed0502f4a47cc182854d9dd7aac903;p=xfstests-dev.git fstests: don't oom the box opening tmpfiles For the t_open_tmpfiles tests, limit ourselves to half of file-max so that we don't OOM the test machine. [Eryu: fix comments too to match the new limit] Signed-off-by: Darrick J. Wong Reviewed-by: Allison Henderson Signed-off-by: Eryu Guan --- diff --git a/tests/generic/530 b/tests/generic/530 index a2968d25..b0d188b1 100755 --- a/tests/generic/530 +++ b/tests/generic/530 @@ -39,10 +39,10 @@ rm -f $seqres.full _scratch_mkfs >> $seqres.full 2>&1 _scratch_mount -# Set ULIMIT_NOFILE to min(file-max, 50000 files per LOAD_FACTOR) +# Set ULIMIT_NOFILE to min(file-max / 2, 50000 files per LOAD_FACTOR) # so that this test doesn't take forever or OOM the box max_files=$((50000 * LOAD_FACTOR)) -max_allowable_files=$(( $(cat /proc/sys/fs/file-max) )) +max_allowable_files=$(( $(cat /proc/sys/fs/file-max) / 2 )) test $max_allowable_files -gt 0 && test $max_files -gt $max_allowable_files && \ max_files=$max_allowable_files ulimit -n $max_files diff --git a/tests/generic/531 b/tests/generic/531 index f3eb5cde..8ce4cc93 100755 --- a/tests/generic/531 +++ b/tests/generic/531 @@ -41,10 +41,10 @@ _scratch_mount # Try to load up all the CPUs, two threads per CPU. nr_cpus=$(( $(getconf _NPROCESSORS_ONLN) * 2 )) -# Set ULIMIT_NOFILE to min(file-max, 50000 files per LOAD_FACTOR) +# Set ULIMIT_NOFILE to min(file-max / 2, 50000 files per LOAD_FACTOR) # so that this test doesn't take forever or OOM the box max_files=$((50000 * LOAD_FACTOR)) -max_allowable_files=$(( $(cat /proc/sys/fs/file-max) )) +max_allowable_files=$(( $(cat /proc/sys/fs/file-max) / 2 )) test $max_allowable_files -gt 0 && test $max_files -gt $max_allowable_files && \ max_files=$max_allowable_files ulimit -n $max_files diff --git a/tests/xfs/501 b/tests/xfs/501 index 51cdb020..974f3414 100755 --- a/tests/xfs/501 +++ b/tests/xfs/501 @@ -44,10 +44,10 @@ rm -f $seqres.full _scratch_mkfs >> $seqres.full 2>&1 _scratch_mount -# Set ULIMIT_NOFILE to min(file-max, 30000 files per LOAD_FACTOR) +# Set ULIMIT_NOFILE to min(file-max / 2, 30000 files per LOAD_FACTOR) # so that this test doesn't take forever or OOM the box max_files=$((30000 * LOAD_FACTOR)) -max_allowable_files=$(( $(cat /proc/sys/fs/file-max) )) +max_allowable_files=$(( $(cat /proc/sys/fs/file-max) / 2 )) test $max_allowable_files -gt 0 && test $max_files -gt $max_allowable_files && \ max_files=$max_allowable_files ulimit -n $max_files diff --git a/tests/xfs/502 b/tests/xfs/502 index bfb063f4..0a7921a3 100755 --- a/tests/xfs/502 +++ b/tests/xfs/502 @@ -43,10 +43,10 @@ _scratch_mount # Load up all the CPUs, two threads per CPU. nr_cpus=$(( $(getconf _NPROCESSORS_ONLN) * 2 )) -# Set ULIMIT_NOFILE to min(file-max, 30000 files per cpu per LOAD_FACTOR) +# Set ULIMIT_NOFILE to min(file-max / 2, 30000 files per cpu per LOAD_FACTOR) # so that this test doesn't take forever or OOM the box max_files=$((30000 * LOAD_FACTOR)) -max_allowable_files=$(( $(cat /proc/sys/fs/file-max) )) +max_allowable_files=$(( $(cat /proc/sys/fs/file-max) / 2 )) test $max_allowable_files -gt 0 && test $max_files -gt $max_allowable_files && \ max_files=$max_allowable_files ulimit -n $max_files