]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
fstests: don't oom the box opening tmpfiles
authorDarrick J. Wong <darrick.wong@oracle.com>
Tue, 26 Feb 2019 02:35:29 +0000 (18:35 -0800)
committerEryu Guan <guaneryu@gmail.com>
Sat, 2 Mar 2019 09:31:40 +0000 (17:31 +0800)
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>
tests/generic/530
tests/generic/531
tests/xfs/501
tests/xfs/502

index a2968d255b801cb578a0e70ff5aae19b7d1216f4..b0d188b1e2c5167df738bf211fd54d62b1fe88cc 100755 (executable)
@@ -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
index f3eb5cde8a5559849a9d37915e0a422a14a68346..8ce4cc938001751cae3f1c195724c2557fb3e136 100755 (executable)
@@ -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
index 51cdb020cec55ddcd11b50ef4dddb629a31b1ab9..974f341401dd4bd6d8f2ed855398f155babf84a4 100755 (executable)
@@ -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
index bfb063f4338e6a4986a0ab5de129ff9e9cc0a81c..0a7921a39077399629da437584b49a2f7a9131b0 100755 (executable)
@@ -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