mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
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 <darrick.wong@oracle.com> Reviewed-by: Allison Henderson <allison.henderson@oracle.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This commit is contained in:
committed by
Eryu Guan
parent
77df6c6ccf
commit
dd2c726684
+2
-2
@@ -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
|
||||
|
||||
+2
-2
@@ -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
|
||||
|
||||
+2
-2
@@ -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
|
||||
|
||||
+2
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user