From 07f3d7558fe5ba6c75d28375ec7995fd9525b80b Mon Sep 17 00:00:00 2001 From: Marshall Garey <marshall@schedmd.com> Date: Tue, 27 Mar 2018 15:16:20 -0600 Subject: [PATCH] testsuite - update test 17.8 to work around MaxTime limit on partition Remove partition MaxTime limit at the beginning of the test, run the rest of the test, then restore the partition configuration with scontrol reconfigure. Bug 4915. --- testsuite/expect/test17.8 | 44 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/testsuite/expect/test17.8 b/testsuite/expect/test17.8 index 9f7965f8e4d..c813f541b0b 100755 --- a/testsuite/expect/test17.8 +++ b/testsuite/expect/test17.8 @@ -41,6 +41,44 @@ set time_get 0 print_header $test_id +# +# We must be SlurmUser or root in order to change the partition MaxTime limit, +# otherwise this test may fail. +# +if {[test_super_user] == 0} { + log_warn "You must be SlurmUser or root to run this test." + exit 0 +} + +set default_part [default_partition] +if { $default_part == "" } { + log_error "Unable to get the default partition." + exit 1 +} + +# +# Ensure that MaxTime is UNLIMITED so this test won't fail due to trying to set +# time limits greater than MaxTime. +# +spawn $scontrol update partitionname=$default_part MaxTime=-1 +expect { + timeout { + log_error "scontrol not responding" + set exit_code 1 + } + eof { + wait + } +} +if { $exit_code == 1 } { + exit $exit_code +} +set maxtime [get_partition_maximum_time_limit $default_part] +if { $maxtime != -1 } { + log_error "Unable to update partition MaxTime" + exit 1 +} + # # Delete left-over stdin/out/err files # Build stdin file @@ -184,6 +222,12 @@ if {$time_get != 1500} { } cancel_job $job_id +# +# Restore partition MaxTime. +# reconfigure will set exit_code and log any errors if it fails. +# +reconfigure + if {$exit_code == 0} { exec $bin_rm -f $file_in send_user "\nSUCCESS\n" -- GitLab