From 7edfe1ba9b8fda0129ae4b89db73bccd49a4317b Mon Sep 17 00:00:00 2001
From: Morris Jette <jette@schedmd.com>
Date: Tue, 26 Jul 2011 09:12:25 -0700
Subject: [PATCH] fix regression tests when mem limit present

If system is configured with a default memory limit, that applies to both the job
and job step which can prevent the expected number of job steps from being started.
Two tests were modified to explicitly set a job step memory limit to start more steps.
---
 testsuite/expect/test1.35 | 6 +++++-
 testsuite/expect/test9.8  | 7 +++++--
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/testsuite/expect/test1.35 b/testsuite/expect/test1.35
index f01045b66b1..5ab95693268 100755
--- a/testsuite/expect/test1.35
+++ b/testsuite/expect/test1.35
@@ -57,11 +57,15 @@ if {[test_cray]} {
 # Build input script file
 # Sleep between initiation of job steps to avoid overwhelming slurmd
 #
+# NOTE: Explicity set a small memory limit. Without explicitly setting the step
+#   memory limit, it will use the system default (same as the job) which may
+#   prevent the level of parallelism desired.
+#
 exec $bin_rm -f $file_in $file_out $file_err
 make_bash_script $file_in "
   for ((i = 0; i < $steps_started; i++)); do
     j=`expr $steps_started + 15 - \$i`
-    $srun $bin_sleep \$j &
+    $srun -N1 -n1 --mem-per-cpu=1 $bin_sleep \$j &
     $bin_sleep 1
   done
   $bin_sleep 2
diff --git a/testsuite/expect/test9.8 b/testsuite/expect/test9.8
index 288e821dc3f..4a0434e9869 100755
--- a/testsuite/expect/test9.8
+++ b/testsuite/expect/test9.8
@@ -64,14 +64,17 @@ if {[test_front_end] != 0 || $enable_memory_leak_debug != 0} {
 # NOTE: The initial sleep is so that all of the submissions have time
 #   to occur before contending with a multitude of job step creations.
 #   This is especially important on very slow systems (e.g. AIX).
+# NOTE: Explicity set a small memory limit. Without explicitly setting the step
+#   memory limit, it will use the system default (same as the job) which may
+#   prevent the level of parallelism desired.
 #
 make_bash_script $file_in "
 $bin_sleep 5
 ulimit -u `ulimit -u -H`
 for ((inx=0; inx < $task_cnt; inx++)) ; do
-        $srun -N1 -n1 $bin_sleep $sleep_time &
+        $srun -N1 -n1 --mem-per-cpu=1 $bin_sleep $sleep_time &
 done
-$srun -N1 -n1 $bin_sleep $sleep_time
+$srun -N1 -n1 --mem-per-cpu=1 $bin_sleep $sleep_time
 "
 
 #
-- 
GitLab