diff --git a/testsuite/expect/globals b/testsuite/expect/globals index 9e74e1e4d656d0de664774b9dbb72fcb1c2e6874..9c3be433e19e591306640b76316102e60e3a9f1f 100755 --- a/testsuite/expect/globals +++ b/testsuite/expect/globals @@ -38,14 +38,14 @@ global sacct salloc sattach sbatch sbcast scancel scontrol sinfo slaunch smap sq # Conditional set. Only set variable if variable does not yet exist. proc cset {name value} { - if {![uplevel 1 info exists $name]} { - upvar $name tmp - set tmp $value - } + if {![uplevel 1 info exists $name]} { + upvar $name tmp + set tmp $value + } } if [file exists globals.local] { - source globals.local + source globals.local } # @@ -405,63 +405,65 @@ proc wait_for_file { file_name } { ################################################################ proc wait_for_job { job_id desired_state } { - global scontrol - - # First verify that desired_state is supported - switch $desired_state { - "DONE" {} - "RUNNING" {} - default { - send_user "Unsupported desired state: $desired_state\n" - return 1 - } - } - - set sleep_time 1 - while 1 { - set fd [open "|$scontrol -o show job $job_id"] - gets $fd line - catch {close $fd} - if {[regexp {JobState\s*=\s*(\w+)} $line foo state] != 1} { - set state "NOT_FOUND" - } + global scontrol - switch $state { - "NOT_FOUND" - - "CANCELLED" - - "FAILED" - - "TIMEOUT" - - "NODE_FAIL" - - "COMPLETED" { - if {[string compare $desired_state "DONE"] == 0} { - send_user "Job $job_id is DONE\n" - sleep 2 - return 0 - } else { - if {[string compare $desired_state "RUNNING"] == 0} { - send_user "Job $job_id is $state, but we wanted RUNNING\n" - } - return 1 - } - } - "RUNNING" { - if {[string compare $desired_state "RUNNING"] == 0} { - send_user "Job $job_id is RUNNING\n" - return 0 - } - send_user "Job $job_id is in state $state, desire $desired_state\n" - } - default { - send_user "Job $job_id is in state $state, desire $desired_state\n" - } + # First verify that desired_state is supported + switch $desired_state { + "DONE" {} + "RUNNING" {} + default { + send_user "Unsupported desired state: $desired_state\n" + return 1 + } } - sleep $sleep_time - set sleep_time [expr $sleep_time * 2] - if { $sleep_time > 10 } { - set sleep_time 10 + set sleep_time 1 + while 1 { + set fd [open "|$scontrol -o show job $job_id"] + gets $fd line + catch {close $fd} + if {[regexp {JobState\s*=\s*(\w+)} $line foo state] != 1} { + set state "NOT_FOUND" + } + + switch $state { + "NOT_FOUND" - + "CANCELLED" - + "FAILED" - + "TIMEOUT" - + "NODE_FAIL" - + "COMPLETED" { + if {[string compare $desired_state "DONE"] == 0} { + send_user "Job $job_id is DONE\n" + sleep 2 + return 0 + } + if {[string compare $desired_state "RUNNING"] == 0} { + send_user "Job $job_id is $state, " + send_user "but we wanted RUNNING\n" + } + return 1 + } + "RUNNING" { + if {[string compare $desired_state "RUNNING"] == 0} { + send_user "Job $job_id is RUNNING\n" + return 0 + } + send_user "Job $job_id is in state $state, " + send_user "desire $desired_state\n" + } + default { + send_user "Job $job_id is in state $state, " + send_user "desire $desired_state\n" + } + } + + sleep $sleep_time + set sleep_time [expr $sleep_time * 2] + if { $sleep_time > 10 } { + set sleep_time 10 + } } - } } ################################################################ @@ -718,15 +720,15 @@ proc dec2hex16 {value} { ################################################################ proc available_nodes { partition } { - global sinfo - - set available -1 - send_user "$sinfo --noheader --partition $partition --state idle,alloc,comp --format %D\n" - set fd [open "|$sinfo --noheader --partition $partition --state idle,alloc,comp --format %D"] - gets $fd line - catch {close $fd} - regexp {\d+} $line available - return $available + global sinfo + + set available -1 + send_user "$sinfo --noheader --partition $partition --state idle,alloc,comp --format %D\n" + set fd [open "|$sinfo --noheader --partition $partition --state idle,alloc,comp --format %D"] + gets $fd line + catch {close $fd} + regexp {\d+} $line available + return $available } @@ -741,23 +743,23 @@ proc available_nodes { partition } { ################################################################ proc default_partition {} { - global scontrol - - set name "" - set fd [open "|$scontrol --all --oneliner show partition"] - while {[gets $fd line] != -1} { - if {[regexp {^PartitionName=(\w+).*Default=YES} $line frag name] - == 1} { - break + global scontrol + + set name "" + set fd [open "|$scontrol --all --oneliner show partition"] + while {[gets $fd line] != -1} { + if {[regexp {^PartitionName=(\w+).*Default=YES} $line frag name] + == 1} { + break + } } - } - catch {close $fd} + catch {close $fd} - if {[string length $name] == 0} { - send_user "ERROR: could not identify the default partition\n" - } + if {[string length $name] == 0} { + send_user "ERROR: could not identify the default partition\n" + } - return $name + return $name } ################################################################ @@ -771,23 +773,23 @@ proc default_partition {} { ################################################################ proc switch_type {} { - global scontrol - - set name "" - set fd [open "|$scontrol show config"] - while {[gets $fd line] != -1} { - if {[regexp {^SwitchType *= switch/(\w+)} $line frag name] - == 1} { - break - } - } - catch {close $fd} + global scontrol - if {[string length $name] == 0} { - send_user "ERROR: could not identify the switch type" - } + set name "" + set fd [open "|$scontrol show config"] + while {[gets $fd line] != -1} { + if {[regexp {^SwitchType *= switch/(\w+)} $line frag name] + == 1} { + break + } + } + catch {close $fd} + + if {[string length $name] == 0} { + send_user "ERROR: could not identify the switch type" + } - return $name + return $name } @@ -811,14 +813,14 @@ proc switch_type {} { ################################################################ proc make_bash_script { script_name script_contents } { - global bin_bash bin_chmod - - file delete $script_name - set fd [open $script_name "w"] - puts $fd "#!$bin_bash" - puts $fd $script_contents - close $fd - exec $bin_chmod 700 $script_name + global bin_bash bin_chmod + + file delete $script_name + set fd [open $script_name "w"] + puts $fd "#!$bin_bash" + puts $fd $script_contents + close $fd + exec $bin_chmod 700 $script_name } ################################################################ diff --git a/testsuite/expect/test1.55 b/testsuite/expect/test1.55 index 45ce1a71e34dc4fc12578a4a0a4b709e3dba21af..090e161c08b5ec1825786a44b3f1400e6520a198 100755 --- a/testsuite/expect/test1.55 +++ b/testsuite/expect/test1.55 @@ -42,13 +42,13 @@ print_header $test_id # exec $bin_rm -f $test_script make_bash_script $test_script { - echo "Running" + echo "Running" - sleep 5 + sleep 5 - for ((i = 0; i < 100; i++)); do - cat /etc/hosts - done + for ((i = 0; i < 100; i++)); do + cat /etc/hosts + done } # @@ -60,17 +60,17 @@ set timeout $max_job_delay set jobid 0 set stepid 0 expect { - -re "launching (($number)\.0)" { - set stepid $expect_out(1,string) - set jobid $expect_out(2,string) - exp_continue - } - "Running" {} - timeout { - send_user "\nFAILURE: Failed to launch test program through srun\n" - catch {exec $scancel $jobid} - exit 1 - } + -re "launching (($number)\.0)" { + set stepid $expect_out(1,string) + set jobid $expect_out(2,string) + exp_continue + } + "Running" {} + timeout { + send_user "\nFAILURE: Failed to launch test program through srun\n" + catch {exec $scancel $jobid} + exit 1 + } } if {$jobid == 0} { send_user "\nFAILURE: Failed to launch test program through srun\n" @@ -91,16 +91,16 @@ close $file set running "seed" set i 0 while {[string compare $running ""]} { - set running [exec $squeue --noheader --states=running --steps=$stepid] - sleep 1 - if {$i == 30} { - send_user "\nFAILURE: job step is not completing\n" - exec $scancel -q $jobid - sleep 5 - exec kill -9 $srun_pid - exit 1 - } - incr i 1 + set running [exec $squeue --noheader --states=running --steps=$stepid] + sleep 1 + if {$i == 30} { + send_user "\nFAILURE: job step is not completing\n" + exec $scancel -q $jobid + sleep 5 + exec kill -9 $srun_pid + exit 1 + } + incr i 1 } send_user "Test sees step is gone, srun should have exited as well.\n" @@ -109,11 +109,11 @@ send_user "Test sees step is gone, srun should have exited as well.\n" # have exited by now). # if [catch {exec kill -0 $srun_pid}] { - send_user "\nSUCCESS\n" - exec $bin_rm -f $test_script - exit 0 + send_user "\nSUCCESS\n" + exec $bin_rm -f $test_script + exit 0 } else { - send_user "\nFAILURE: srun is still running after job exits!\n" - exec kill -9 $srun_pid - exit 1 + send_user "\nFAILURE: srun is still running after job exits!\n" + exec kill -9 $srun_pid + exit 1 } diff --git a/testsuite/expect/test1.58 b/testsuite/expect/test1.58 index 9864dbc63dda7c4c99905317bc2701798c9a6c34..e8326c5b0334e929300dae4e9ffe28d3dea67308 100755 --- a/testsuite/expect/test1.58 +++ b/testsuite/expect/test1.58 @@ -44,14 +44,15 @@ set timeout $max_job_delay set srun_alloc_pid [spawn $srun -v -N1 -n1 -A $bin_sleep 600] set srun_alloc_sid $spawn_id expect { - -re "srun: jobid ($number)" { - set jobid $expect_out(1,string) - } - timeout { - send_user "\nFAILURE: srun failed to grab an allocation in a timely manner.\n" - exec kill $srun_alloc_pid - exit 1 - } + -re "srun: jobid ($number)" { + set jobid $expect_out(1,string) + } + timeout { + send_user "\nFAILURE: srun failed to grab an allocation " + send_user "in a timely manner.\n" + exec kill $srun_alloc_pid + exit 1 + } } # @@ -62,27 +63,27 @@ set pattern "sdiouetj49udfj" set got_pattern 0 set srun_launch_pid [spawn $srun --jobid $jobid echo $pattern] expect { - -re "error" { - send_user "\nFAILURE: unexpected error occurred\n" - set exit_code 1 - } - -re $pattern { - set got_pattern 1 - exp_continue - } - timeout { - exec kill $srun_launch_pid - exec kill $srun_launch_pid - exec kill -9 $srun_launch_pid - } - eof { - wait - } + -re "error" { + send_user "\nFAILURE: unexpected error occurred\n" + set exit_code 1 + } + -re $pattern { + set got_pattern 1 + exp_continue + } + timeout { + exec kill $srun_launch_pid + exec kill $srun_launch_pid + exec kill -9 $srun_launch_pid + } + eof { + wait + } } if {$got_pattern == 0} { - send_user "\nFAILURE: unable to srun step under existing job allocation\n" - set exit_code 1 + send_user "\nFAILURE: unable to srun step under existing job allocation\n" + set exit_code 1 } # @@ -92,15 +93,15 @@ exec $scancel $jobid set spawn_id $srun_alloc_sid exec kill -9 $srun_alloc_pid expect { - timeout { - exec kill -9 $srun_alloc_pid - } - eof { - wait - } + timeout { + exec kill -9 $srun_alloc_pid + } + eof { + wait + } } if {$got_pattern == 1} { - send_user "\nSUCCESS\n" + send_user "\nSUCCESS\n" } exit $exit_code diff --git a/testsuite/expect/test1.83 b/testsuite/expect/test1.83 index b8ab57e857c55d6ee51fdf6313fc6409b91d2f49..9ec46a11afa24713b2a3e5279551174fa8046f57 100755 --- a/testsuite/expect/test1.83 +++ b/testsuite/expect/test1.83 @@ -49,8 +49,9 @@ if {[test_front_end] != 0} { set available [available_nodes [default_partition]] if {$available < 3} { - send_user "\nWARNING: This test requires 3 nodes, but only $available available\n" - exit 0 + send_user "\nWARNING: This test requires 3 nodes, " + send_user "but only $available available\n" + exit 0 } # @@ -126,7 +127,8 @@ expect { # Verify node count # if {[test_front_end] != 0} { - send_user "\nWARNING: Additional testing is incompatable with front-end systems\n" + send_user "\nWARNING: Additional testing is incompatable " + send_user "with front-end systems\n" exit $exit_code } diff --git a/testsuite/expect/test15.10 b/testsuite/expect/test15.10 index f8928b4f51fe651ecfc6e070ab2e384477030af5..27c715d21adb0cbc0a61e3fd4f71792d34c773b3 100755 --- a/testsuite/expect/test15.10 +++ b/testsuite/expect/test15.10 @@ -41,7 +41,7 @@ for {set inx 1} {$inx < 4} {set inx [expr $inx * 2]} { set tasks_set $inx set tasks_get 0 set timeout $max_job_delay - spawn $salloc -n$tasks_set -t1 $bin_bash + set salloc_pid [spawn $salloc -n$tasks_set -t1 $bin_bash] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -60,7 +60,7 @@ for {set inx 1} {$inx < 4} {set inx [expr $inx * 2]} { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } diff --git a/testsuite/expect/test15.13 b/testsuite/expect/test15.13 index f606264d9df0d93af7ddb1aa1b0f7b2781d2215c..57b46d20554d22d835ae18fb0d42496ce3012d96 100755 --- a/testsuite/expect/test15.13 +++ b/testsuite/expect/test15.13 @@ -56,7 +56,7 @@ array set good_vars { # Spawn a job via salloc to print environment variables # set job_id 0 -spawn $salloc -N1 -t1 -v $bin_env +set salloc_pid [spawn $salloc -N1 -t1 -v $bin_env] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -69,7 +69,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } diff --git a/testsuite/expect/test15.15 b/testsuite/expect/test15.15 index 2f1cb0193f373abc9efbd5da0e9877ff390b3826..89f0ae820d6813f5671aab5f36f2891bca522dc9 100755 --- a/testsuite/expect/test15.15 +++ b/testsuite/expect/test15.15 @@ -43,7 +43,7 @@ print_header $test_id # set timeout $max_job_delay set job_id 0 -spawn $salloc -N1 -t1 --bell $bin_id +set salloc_pid [spawn $salloc -N1 -t1 --bell $bin_id] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -56,7 +56,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } @@ -76,7 +76,7 @@ if {$job_id == 0} { # Run trivial test --bell option # set job_id 0 -spawn $salloc -N1 -t1 --no-bell $bin_id +set salloc_pid [spawn $salloc -N1 -t1 --no-bell $bin_id] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -89,7 +89,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } diff --git a/testsuite/expect/test15.16 b/testsuite/expect/test15.16 index 3074a545f0f606d00ec77924a63613bcdc53d219..c9ad8d3de5eb1ad276d873249c1c6d01531faf13 100755 --- a/testsuite/expect/test15.16 +++ b/testsuite/expect/test15.16 @@ -44,7 +44,7 @@ print_header $test_id # set job_id 0 set env("SALLOC_BELL") 1 -spawn $salloc -N1 -t1 $bin_id +set salloc_pid [spawn $salloc -N1 -t1 $bin_id] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -57,7 +57,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } @@ -79,7 +79,7 @@ if {$job_id == 0} { # set job_id 0 set env("SALLOC_NO_BELL") 1 -spawn $salloc -N1 -t1 $bin_id +set salloc_pid [spawn $salloc -N1 -t1 $bin_id] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -92,7 +92,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } diff --git a/testsuite/expect/test15.18 b/testsuite/expect/test15.18 index 18a8348e911084747d49e50ae8c0935ca17e00d4..37b4ac657adac735934f6360092e9f8a2befc75a 100755 --- a/testsuite/expect/test15.18 +++ b/testsuite/expect/test15.18 @@ -47,7 +47,7 @@ if {[test_front_end] != 0 && [test_super_user] == 0} { set job_id 0 set matches 0 set timeout $max_job_delay -spawn $salloc -N1 -t1 /bad/bad/bad +set salloc_pid [spawn $salloc -N1 -t1 /bad/bad/bad] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -61,7 +61,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } diff --git a/testsuite/expect/test15.19 b/testsuite/expect/test15.19 index fe4abd63c8c20f1b7bcb1439c2d252767863e695..2f60adf48bfee485820746fc30c3a16240d33bc1 100755 --- a/testsuite/expect/test15.19 +++ b/testsuite/expect/test15.19 @@ -46,7 +46,7 @@ set job_id 0 set host_0 "" set task_cnt 0 set timeout $max_job_delay -spawn $salloc -N1-1 -t1 $slaunch -c 1 -l $bin_printenv SLURMD_NODENAME +set salloc_pid [spawn $salloc -N1-1 -t1 $slaunch -c 1 -l $bin_printenv SLURMD_NODENAME] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -69,7 +69,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } @@ -92,7 +92,7 @@ if {[string compare $host_0 ""] == 0} { set alloc_fail 0 set job_id 0 set task_cnt2 0 -spawn $salloc -N1-1 -w $host_0 -t1 $slaunch -n [expr $task_cnt + 1] -l $bin_printenv SLURMD_NODENAME +set salloc_pid [spawn $salloc -N1-1 -w $host_0 -t1 $slaunch -n [expr $task_cnt + 1] -l $bin_printenv SLURMD_NODENAME] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -109,7 +109,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } @@ -137,7 +137,7 @@ set job_id 0 set host_0 "" set host_1 "" -spawn $salloc -N1-1 -t1 $slaunch -l $bin_printenv SLURMD_NODENAME +set salloc_pid [spawn $salloc -N1-1 -t1 $slaunch -l $bin_printenv SLURMD_NODENAME] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -155,7 +155,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } @@ -191,7 +191,7 @@ set host_1 "" set host_2 "" set host_3 "" set timeout $max_job_delay -spawn $salloc -N1-3 -t1 $slaunch -l $bin_printenv SLURMD_NODENAME +set salloc_pid [spawn $salloc -N1-3 -t1 $slaunch -l $bin_printenv SLURMD_NODENAME] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -215,7 +215,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } @@ -262,7 +262,7 @@ set host_1 "" set host_2 "" set host_3 "" set timeout $max_job_delay -spawn $salloc -N2-3 -t1 $slaunch -l $bin_printenv SLURMD_NODENAME +set salloc_pid [spawn $salloc -N2-3 -t1 $slaunch -l $bin_printenv SLURMD_NODENAME] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -290,7 +290,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } diff --git a/testsuite/expect/test15.20 b/testsuite/expect/test15.20 index 67e7b5a9ed26f24d74f96065baf7961448b9c229..d2787b5950448ffa106a5b84d961ff8373ce8392 100755 --- a/testsuite/expect/test15.20 +++ b/testsuite/expect/test15.20 @@ -65,7 +65,7 @@ if {$available < $node_cnt} { exit $exit_code } -spawn $salloc -N$node_cnt -t1 $slaunch -l $bin_hostname +set salloc_pid [spawn $salloc -N$node_cnt -t1 $slaunch -l $bin_hostname] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -98,7 +98,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } @@ -156,7 +156,7 @@ set host_1 "" set host_2 "" set job_id 0 set timeout $max_job_delay -spawn $salloc -N2 -t1 --exclude=$exclude_node $slaunch -l $bin_hostname +set salloc_pid [spawn $salloc -N2 -t1 --exclude=$exclude_node $slaunch -l $bin_hostname] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -184,7 +184,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } @@ -229,7 +229,7 @@ set host_0 "" set host_1 "" set job_id 0 set timeout $max_job_delay -spawn $salloc -N1 -t1 --nodelist=$include_node $slaunch -l $bin_hostname +set salloc_pid [spawn $salloc -N1 -t1 --nodelist=$include_node $slaunch -l $bin_hostname] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -247,7 +247,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } diff --git a/testsuite/expect/test15.21 b/testsuite/expect/test15.21 index f9ef8211fdd53613f56704a2bb4f50d560da850c..8e28e30100b8f1a46d8e50ad5093be3839959cb3 100755 --- a/testsuite/expect/test15.21 +++ b/testsuite/expect/test15.21 @@ -63,7 +63,7 @@ set host_1_num 0 set host_2_num 0 set job_id 0 set timeout $max_job_delay -spawn $salloc -N3-3 --contiguous --immediate -t1 $slaunch -l $bin_printenv SLURMD_NODENAME +set salloc_pid [spawn $salloc -N3-3 --contiguous --immediate -t1 $slaunch -l $bin_printenv SLURMD_NODENAME] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -104,7 +104,7 @@ expect { } timeout { if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } diff --git a/testsuite/expect/test15.23 b/testsuite/expect/test15.23 index d1690252146e3b060decb2ad529c2ed4aba55115..46afaf971ede21dbb5a0763fda13dd9686307564 100755 --- a/testsuite/expect/test15.23 +++ b/testsuite/expect/test15.23 @@ -51,7 +51,7 @@ set env(SALLOC_TIMELIMIT) 2 # Spawn a job via slaunch using these environment variables # set matches 0 -spawn $salloc -N1 $bin_bash +set salloc_pid [spawn $salloc -N1 $bin_bash] expect { -re "debug: Entering _msg_thr_create" { incr matches @@ -79,7 +79,7 @@ expect { timeout { send_user "\nFAILURE: srun not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } diff --git a/testsuite/expect/test15.4 b/testsuite/expect/test15.4 index aa0407fa51c0961d99a73f606784a5a4045bbb09..19e81d6f6134a58de15d4b7631679c96660821df 100755 --- a/testsuite/expect/test15.4 +++ b/testsuite/expect/test15.4 @@ -71,7 +71,7 @@ if {$got_login_grps == 0} { # set timeout $max_job_delay set job_id 0 -spawn $salloc -N1 -t1 $slaunch $bin_id +set salloc_pid [spawn $salloc -N1 -t1 $slaunch $bin_id] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -85,7 +85,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } diff --git a/testsuite/expect/test15.5 b/testsuite/expect/test15.5 index 540838f4ab82637632ab06841b101e2b0439da54..7fff869c007b6577e4caf4cac2c480464aaab350 100755 --- a/testsuite/expect/test15.5 +++ b/testsuite/expect/test15.5 @@ -103,7 +103,7 @@ make_bash_script $file_in " # set timeout [expr $max_job_delay + $sleep_time] set job_id 0 -spawn $salloc -t1 --kill-command ./$file_in +set salloc_pid [spawn $salloc -t1 --kill-command ./$file_in] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -117,7 +117,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } @@ -131,7 +131,7 @@ expect { set completions 0 set job_id 0 -spawn $salloc -t4 --kill-command ./$file_in +set salloc_pid [spawn $salloc -t4 --kill-command ./$file_in] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -144,7 +144,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } diff --git a/testsuite/expect/test15.6 b/testsuite/expect/test15.6 index 1644aa98fdbc78dd7230d84f55de0d308c4f7292..019774cea1c5b11c9da33518635a21d5ef0f6e66 100755 --- a/testsuite/expect/test15.6 +++ b/testsuite/expect/test15.6 @@ -47,7 +47,7 @@ print_header $test_id # 3: debug2 (-vvv) # set timeout $max_job_delay -spawn $salloc -vv -N1 -t1 $bin_id +set salloc_pid [spawn $salloc -vv -N1 -t1 $bin_id] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -72,7 +72,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } diff --git a/testsuite/expect/test15.7 b/testsuite/expect/test15.7 index 207ebf4941e8caa13a0156f05f4a2da1fee08d6b..16d7069ea7f58943064b89ef4fc0a947ed5b478e 100755 --- a/testsuite/expect/test15.7 +++ b/testsuite/expect/test15.7 @@ -48,7 +48,7 @@ print_header $test_id # # Spawn a salloc job with constraints # -spawn $salloc --mincpus=$cpu_cnt --mem=$mem_size --tmp=$tmp_size --hold -t1 $bin_id +set salloc_pid [spawn $salloc --mincpus=$cpu_cnt --mem=$mem_size --tmp=$tmp_size --hold -t1 $bin_id] expect { -re "Pending job allocation ($number)" { set job_id $expect_out(1,string) @@ -59,8 +59,12 @@ expect { exp_continue } timeout { - send_user "\nFAILURE: srun not responding\n" - kill_salloc + send_user "\nFAILURE: salloc not responding\n" + if {$job_id == 0} { + slow_kill $salloc_pid + } else { + cancel_job $job_id + ] set exit_code 1 exp_continue } diff --git a/testsuite/expect/test15.8 b/testsuite/expect/test15.8 index 7192506d6815ae771b8c2a8979ac67f40d23799e..0ea85948a7e55ac2918384f4985faf573a53a1c2 100755 --- a/testsuite/expect/test15.8 +++ b/testsuite/expect/test15.8 @@ -42,7 +42,7 @@ print_header $test_id # The job can't run immediately with a priority of zero # set timeout 10 -spawn $salloc --immediate --hold -t1 -v $bin_pwd +set salloc_pid [spawn $salloc --immediate --hold -t1 -v $bin_pwd] expect { -re "Pending job allocation ($number)" { set job_id $expect_out(1,string) @@ -56,7 +56,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } @@ -79,7 +79,7 @@ if {$matches != 1} { # set job_id 0 set matches 0 -spawn $salloc --immediate -t1 $bin_pwd +set salloc_pid [spawn $salloc --immediate -t1 $bin_pwd] expect { -re "error" { send_user "This error is not unexpected, no worries\n" @@ -94,7 +94,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } diff --git a/testsuite/expect/test16.4 b/testsuite/expect/test16.4 index 34599bb27891af290571d9ab23c7cf25b6586174..131184811cc2b162b81289f82526f818a6b1834e 100755 --- a/testsuite/expect/test16.4 +++ b/testsuite/expect/test16.4 @@ -51,7 +51,7 @@ exec $bin_chmod 700 $file_prog # Spawn initial program via srun # set timeout $max_job_delay -spawn $salloc -N1-4 -t2 $slaunch -n4 --overcommit $file_prog +set salloc_pid [spawn $salloc -N1-4 -t2 $slaunch -n4 --overcommit $file_prog] set init_id $spawn_id expect { -i $init_id @@ -68,7 +68,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } diff --git a/testsuite/expect/test18.10 b/testsuite/expect/test18.10 index df3cab0ab027aeff3b3d4d15f8b892782d8314de..4af7f67ae05aecb7e4e4ed0c09cce9a9f4b0baeb 100755 --- a/testsuite/expect/test18.10 +++ b/testsuite/expect/test18.10 @@ -42,7 +42,7 @@ print_header $test_id # Spawn a program via slaunch with stdout forwarding disabled # set timeout $max_job_delay -spawn $salloc -t1 $slaunch --task-output=none $bin_id +set salloc_pid [spawn $salloc -t1 $slaunch --task-output=none $bin_id] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -61,7 +61,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } @@ -78,7 +78,7 @@ expect { # set job_id 0 set matches 0 -spawn $salloc -t1 -v $slaunch --task-error=/dev/null $bin_sleep aaa +set salloc_pid [spawn $salloc -t1 -v $slaunch --task-error=/dev/null $bin_sleep aaa] expect { -re "Pending job allocation ($number)" { set job_id $expect_out(1,string) @@ -97,7 +97,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } diff --git a/testsuite/expect/test18.11 b/testsuite/expect/test18.11 index bc4c27feef67d87a5219acbacb32be85d98f7852..9d17e707a518fb3ed9f10c9c53a3a6456bcf91aa 100755 --- a/testsuite/expect/test18.11 +++ b/testsuite/expect/test18.11 @@ -51,7 +51,7 @@ print_header $test_id # file delete [glob -nocomplain "test$test_id.s.*.output"] set timeout $max_job_delay -spawn $salloc -N1 -t1 $slaunch --task-output=$file_out_t -n$task_cnt --overcommit $bin_id +set salloc_pid [spawn $salloc -N1 -t1 $slaunch --task-output=$file_out_t -n$task_cnt --overcommit $bin_id] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -60,7 +60,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } @@ -97,7 +97,7 @@ if {$file_cnt != $task_cnt} { # set job_id 0 set matches 0 -spawn $salloc -N1 -t1 $slaunch --task-output=/dev/null --task-error=$file_err_j -n$task_cnt --overcommit $bin_sleep aaa +set salloc_pid [spawn $salloc -N1 -t1 $slaunch --task-output=/dev/null --task-error=$file_err_j -n$task_cnt --overcommit $bin_sleep aaa] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -111,7 +111,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } @@ -143,7 +143,7 @@ if {[wait_for_file $file_err_j_glob] == 0} { # file name and confirm it is created # set job_id 0 -spawn $salloc -N1 -t1 $slaunch --task-output=$file_out_J $bin_hostname +set salloc_pid [spawn $salloc -N1 -t1 $slaunch --task-output=$file_out_J $bin_hostname] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -152,7 +152,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } @@ -184,7 +184,7 @@ set file_out_n_glob "test$test_id.n.$node_id.output" file delete $file_out_n_glob set job_id 0 -spawn $salloc -N1 -t1 $slaunch --task-output=$file_out_n -n2 --overcommit $bin_hostname +set salloc_pid [spawn $salloc -N1 -t1 $slaunch --task-output=$file_out_n -n2 --overcommit $bin_hostname] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -193,7 +193,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } diff --git a/testsuite/expect/test18.12 b/testsuite/expect/test18.12 index d846fb578d7bc4fc3eae6dfe4ecc7674742d50dc..8c6dae9ec9da054e22404a61164c000aeee8c201 100755 --- a/testsuite/expect/test18.12 +++ b/testsuite/expect/test18.12 @@ -44,7 +44,7 @@ print_header $test_id # Spawn a shell via slaunch # set timeout $max_job_delay -spawn $salloc -v -N1 -t1 $slaunch -n10 --overcommit --wait=2 --slaunch-input-filter=3 $bin_bash +set salloc_pid [spawn $salloc -v -N1 -t1 $slaunch -n10 --overcommit --wait=2 --slaunch-input-filter=3 $bin_bash] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -69,7 +69,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } diff --git a/testsuite/expect/test18.13 b/testsuite/expect/test18.13 index 85952b338c1c3514a40ee10e23faeebc989184e7..b93a54adecc44db63f1855de0775ea610105a5e0 100755 --- a/testsuite/expect/test18.13 +++ b/testsuite/expect/test18.13 @@ -47,7 +47,7 @@ print_header $test_id # Change working directory on execute line and then print where jobs runs # set timeout $max_job_delay -spawn $salloc -N1 -t1 $slaunch --workdir=$tmp_dir $bin_pwd +set salloc_pid [spawn $salloc -N1 -t1 $slaunch --workdir=$tmp_dir $bin_pwd] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -64,7 +64,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } diff --git a/testsuite/expect/test18.14 b/testsuite/expect/test18.14 index c1f6f3f93fa4ac8f8e0fd833f8ae302a0819836b..335d2d86173cc1f1c9811fb2dbbfb300b450fa9f 100755 --- a/testsuite/expect/test18.14 +++ b/testsuite/expect/test18.14 @@ -69,7 +69,7 @@ array set good_vars { # # Spawn a job via salloc to print environment variables # -spawn $salloc -N1 -t1 $slaunch $bin_env +set salloc_pid [spawn $salloc -N1 -t1 $slaunch $bin_env] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -82,7 +82,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } @@ -98,16 +98,17 @@ set total 0 set good 0 send_user "\n" foreach {slurm_var check_flag} [array get good_vars] { - incr total - if {[info exists found_vars($slurm_var)]} { - if { $check_flag == 1 && $found_vars($slurm_var) <= 0 } { - send_user "FAILURE: Found $slurm_var, but $found_vars($slurm_var) <= 0\n" + incr total + if {[info exists found_vars($slurm_var)]} { + if { $check_flag == 1 && $found_vars($slurm_var) <= 0 } { + send_user "FAILURE: Found $slurm_var, " + send_user "but $found_vars($slurm_var) <= 0\n" + } else { + incr good + } } else { - incr good + send_user "FAILURE: Variable $slurm_var not found\n" } - } else { - send_user "FAILURE: Variable $slurm_var not found\n" - } } if {$good < $total} { diff --git a/testsuite/expect/test18.15 b/testsuite/expect/test18.15 index 85bec1c142d37b25c4de5e8285567bb841365a4c..99fae481dc4aa2467af3746f4f61e09c35c79d48 100755 --- a/testsuite/expect/test18.15 +++ b/testsuite/expect/test18.15 @@ -48,7 +48,7 @@ print_header $test_id # Spawn a job via sbatch to print environment variables # set env($test_env_name) $test_env_val -spawn $salloc -N1 -t1 $slaunch $bin_env +set salloc_pid [spawn $salloc -N1 -t1 $slaunch $bin_env] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -63,7 +63,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } diff --git a/testsuite/expect/test18.16 b/testsuite/expect/test18.16 index 88ea68051346a6dfb1c89725a28510c6ca9dd4ab..248585327bb60cd1719ee1c4cf7032cc5769ca10 100755 --- a/testsuite/expect/test18.16 +++ b/testsuite/expect/test18.16 @@ -125,7 +125,7 @@ make_bash_script $file_in " ./$file_prog_get " -spawn $salloc -N1 -t1 $slaunch ./$file_in +set salloc_pid [spawn $salloc -N1 -t1 $slaunch ./$file_in] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -172,7 +172,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } diff --git a/testsuite/expect/test18.18 b/testsuite/expect/test18.18 index b3378b6b2b22e0ec7b92e67fb6794713e8b7e050..f9ff98eb957deb5bbc8d1f83d0ea19c9a4263505 100755 --- a/testsuite/expect/test18.18 +++ b/testsuite/expect/test18.18 @@ -60,7 +60,7 @@ if { [test_bluegene] } { set job_id 0 set timeout $max_job_delay -spawn $salloc -N$node_cnt -t1 $slaunch -n$task_cnt --overcommit $slaunch -l -n$mult --overcommit $bin_id +set salloc_pid [spawn $salloc -N$node_cnt -t1 $slaunch -n$task_cnt --overcommit $slaunch -l -n$mult --overcommit $bin_id] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -73,7 +73,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } diff --git a/testsuite/expect/test18.19 b/testsuite/expect/test18.19 index 0b4b1a0f9bffb6c63c2c8b24ea9027393a1e5326..99e4c52798aea48e5aade2ccf6d72cbfae749f80 100755 --- a/testsuite/expect/test18.19 +++ b/testsuite/expect/test18.19 @@ -81,7 +81,7 @@ expect { set timeout $max_job_delay set job_id 0 set slaunch_pid 0 -spawn $salloc -N1 -t1 $slaunch -vv --unbuffered $file_prog +set salloc_pid [spawn $salloc -N1 -t1 $slaunch -vv --unbuffered $file_prog] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -118,7 +118,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } diff --git a/testsuite/expect/test18.21 b/testsuite/expect/test18.21 index 2b2983965bcb8b9c83f46c6999a201af8851e1d9..cac6054a0abcfc77164e3a4fc2e1d754158425c4 100755 --- a/testsuite/expect/test18.21 +++ b/testsuite/expect/test18.21 @@ -55,12 +55,12 @@ puts $fd { main() { - char *id = getenv("SLURM_PROCID"); - if (atoi(id) == 9) { - exit(2); - } - sleep(15); - printf("SHOULD_NOT_BE_HERE\n"); + char *id = getenv("SLURM_PROCID"); + if (atoi(id) == 9) { + exit(2); + } + sleep(15); + printf("SHOULD_NOT_BE_HERE\n"); } } close $fd @@ -74,7 +74,7 @@ exec $bin_chmod 700 $file_in # set timeout $max_job_delay set job_id 0 -spawn $salloc -t1 -N1 $slaunch -n10 --overcommit --kill-on-bad-exit $file_in +set salloc_pid [spawn $salloc -t1 -N1 $slaunch -n10 --overcommit --kill-on-bad-exit $file_in] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -91,10 +91,10 @@ expect { } timeout { send_user "\nFAILURE: salloc not responding\n" - if {$job_id_1 != 0} { - cancel_job $job_id_1 + if {$job_id == 0} { + slow_kill $salloc_pid } else { - kill_salloc + cancel_job $job_id_1 } set exit_code 1 exp_continue diff --git a/testsuite/expect/test18.22 b/testsuite/expect/test18.22 index ed9871ef594a8dd8a62107deeda143af938d2bf0..71048c5b930628a08e8e2ce56e228fb1dfe798c3 100755 --- a/testsuite/expect/test18.22 +++ b/testsuite/expect/test18.22 @@ -82,7 +82,7 @@ if { [test_bluegene] } { set node_cnt 1 } -spawn $salloc -N$node_cnt -t1 $slaunch -n$tasks --overcommit --task-prolog=$task_prolog --task-epilog=$task_epilog $file_in +set salloc_pid [spawn $salloc -N$node_cnt -t1 $slaunch -n$tasks --overcommit --task-prolog=$task_prolog --task-epilog=$task_epilog $file_in] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -100,7 +100,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } diff --git a/testsuite/expect/test18.23 b/testsuite/expect/test18.23 index 4c72528bfde68a4958a4303a6125b3f87628334f..2d2d7b76f556ba6a5100d6bfa6f572f593dd392b 100755 --- a/testsuite/expect/test18.23 +++ b/testsuite/expect/test18.23 @@ -47,7 +47,7 @@ if {[test_front_end] != 0 && [test_super_user] == 0} { set job_id 0 set matches 0 set timeout $max_job_delay -spawn $salloc -N1 -t1 $slaunch /bad/bad/bad +set salloc_pid [spawn $salloc -N1 -t1 $slaunch /bad/bad/bad] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -61,7 +61,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } diff --git a/testsuite/expect/test18.25 b/testsuite/expect/test18.25 index f57993a1f67760cd20416e134c64b9fccc9e3f82..b4a12db53ce1b90fd3d4d5f0a35a5b21a4678ce5 100755 --- a/testsuite/expect/test18.25 +++ b/testsuite/expect/test18.25 @@ -67,7 +67,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } diff --git a/testsuite/expect/test18.26 b/testsuite/expect/test18.26 index f6fed66324a5ea13345326e358793aa87d6ef6f9..ff064dc80d8b5b59d72330a543b57242f1f60584 100755 --- a/testsuite/expect/test18.26 +++ b/testsuite/expect/test18.26 @@ -61,7 +61,7 @@ exec $bin_chmod 700 $file_in set job_id 0 set matches 0 set timeout $max_job_delay -spawn $salloc -N1 -t1 $slaunch -n4 --overcommit -l --multi-prog $file_in +set salloc_pid [spawn $salloc -N1 -t1 $slaunch -n4 --overcommit -l --multi-prog $file_in] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -88,7 +88,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } @@ -129,7 +129,7 @@ exec $bin_chmod 700 $file_in set job_id 0 set matches 0 set timed_out 0 -spawn $salloc -N1 -t1 $slaunch -n4 --overcommit -l --multi-prog --debugger-test $file_in +set salloc_pid [spawn $salloc -N1 -t1 $slaunch -n4 --overcommit -l --multi-prog --debugger-test $file_in] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -151,7 +151,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } diff --git a/testsuite/expect/test18.27 b/testsuite/expect/test18.27 index e20136ce8ea373913442b413331153a0e6b895e3..fb98e0ff84b9cba2a66c7385aeca2dbee77f3d93 100755 --- a/testsuite/expect/test18.27 +++ b/testsuite/expect/test18.27 @@ -50,7 +50,7 @@ set job_id 0 set timeout $max_job_delay set expected_layout [list 0 0 1 1] set tested_layout [list -1 -1 -1 -1] -spawn $salloc -N2 -t1 $slaunch -n4 --overcommit -l --distribution=block $bin_printenv SLURM_NODEID +set salloc_pid [spawn $salloc -N2 -t1 $slaunch -n4 --overcommit -l --distribution=block $bin_printenv SLURM_NODEID] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -69,7 +69,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } @@ -98,7 +98,7 @@ set job_id 0 set timeout $max_job_delay set expected_layout [list 0 1 0 1] set tested_layout [list -1 -1 -1 -1] -spawn $salloc -N2 -t1 $slaunch -n4 --overcommit -l --distribution=cyclic $bin_printenv SLURM_NODEID +set salloc_pid [spawn $salloc -N2 -t1 $slaunch -n4 --overcommit -l --distribution=cyclic $bin_printenv SLURM_NODEID] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -117,7 +117,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } diff --git a/testsuite/expect/test18.28 b/testsuite/expect/test18.28 index 84537ed5a8b2fd49980de8613418942cb2434289..7a8397a1119b3c5c5cad2dec62a7f7e50d706aff 100755 --- a/testsuite/expect/test18.28 +++ b/testsuite/expect/test18.28 @@ -50,7 +50,7 @@ for {set inx 1} {$inx <= 4} {set inx [expr $inx * 2]} { set no_fit 0 set task_cnt 0 set timeout $max_job_delay - spawn $salloc -N1-4 -t1 $slaunch -N$inx -l $bin_printenv SLURM_NODEID + set salloc_pid [spawn $salloc -N1-4 -t1 $slaunch -N$inx -l $bin_printenv SLURM_NODEID] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -79,7 +79,7 @@ for {set inx 1} {$inx <= 4} {set inx [expr $inx * 2]} { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } diff --git a/testsuite/expect/test18.29 b/testsuite/expect/test18.29 index d756f7c60e0703c4dde8c063b54302270f1d8495..bc3f4356b23c31e3f2669bd1d9899eb1169eae86 100755 --- a/testsuite/expect/test18.29 +++ b/testsuite/expect/test18.29 @@ -73,22 +73,22 @@ make_bash_script $script_name { set salloc_pid [spawn $salloc -N $node_cnt $slaunch -n 1 $script_name] set salloc_spawn_id $spawn_id expect { - -re "Granted job allocation ($number)" { - set jobid $expect_out(1,string) - } - timeout { - slow_kill $salloc_pid - set exit_code 1 - } + -re "Granted job allocation ($number)" { + set jobid $expect_out(1,string) + } + timeout { + slow_kill $salloc_pid + set exit_code 1 + } } expect { - -re "($number)" { - set cpu_cnt $expect_out(1,string) - } - timeout { - slow_kill $salloc_pid - set exit_code 1 - } + -re "($number)" { + set cpu_cnt $expect_out(1,string) + } + timeout { + slow_kill $salloc_pid + set exit_code 1 + } } file delete $script_name @@ -96,9 +96,9 @@ send_user "cpu count is $cpu_cnt\n" # Check CPU count if {$cpu_cnt < 2} { - send_user "\nWARNING: The node only has one CPU\n" - exec $scancel $jobid - exit $exit_code + send_user "\nWARNING: The node only has one CPU\n" + exec $scancel $jobid + exit $exit_code } # @@ -112,22 +112,23 @@ if {$cpu_cnt < 2} { set task_cnt 0 set pid [spawn $slaunch --jobid $jobid -l --cpus-per-task 1 -n [expr $node_cnt * $cpu_cnt] $bin_printenv SLURMD_NODENAME] expect { - -re "($number): ($alpha_numeric)" { - incr task_cnt - exp_continue - } - eof { - wait - } + -re "($number): ($alpha_numeric)" { + incr task_cnt + exp_continue + } + eof { + wait + } } set expected_task_cnt [expr $node_cnt * $cpu_cnt] if {$task_cnt < $expected_task_cnt} { - send_user "\nFAILURE Test A: Fewer tasks ($task_cnt) then expected ($expected_task_cnt)\n" - set exit_code 1 + send_user "\nFAILURE Test A: Fewer tasks ($task_cnt) then expected ($expected_task_cnt)\n" + set exit_code 1 } if {$task_cnt > $expected_task_cnt} { - send_user "\nFAILURE Test A: More tasks ($task_cnt) then expected ($expected_task_cnt)\n" - set exit_code 1 + send_user "\nFAILURE Test A: More tasks ($task_cnt) then " + send_user "expected ($expected_task_cnt)\n" + set exit_code 1 } # @@ -137,20 +138,20 @@ if {$task_cnt > $expected_task_cnt} { set task_cnt 0 set pid [spawn $slaunch --jobid $jobid -l --cpus-per-task $cpu_cnt -n [expr $node_cnt * $cpu_cnt] $bin_printenv SLURMD_NODENAME] expect { - -re "($number): ($alpha_numeric)" { - incr task_cnt - exp_continue - } - "error: Failed creating job step context" { - send_user "This error was expected!\n" - } - eof { - wait - } + -re "($number): ($alpha_numeric)" { + incr task_cnt + exp_continue + } + "error: Failed creating job step context" { + send_user "This error was expected!\n" + } + eof { + wait + } } if {$task_cnt > 0} { - send_user "FAILURE Test B: Test should NOT have run.\n" - set exit_code 1 + send_user "FAILURE Test B: Test should NOT have run.\n" + set exit_code 1 } @@ -161,22 +162,22 @@ if {$task_cnt > 0} { set task_cnt 0 set pid [spawn $slaunch --jobid $jobid -l --cpus-per-task $cpu_cnt -n $node_cnt $bin_printenv SLURMD_NODENAME] expect { - -re "($number): ($alpha_numeric)" { - incr task_cnt - exp_continue - } - eof { - wait - } + -re "($number): ($alpha_numeric)" { + incr task_cnt + exp_continue + } + eof { + wait + } } set expected_task_cnt $node_cnt if {$task_cnt < $expected_task_cnt} { - send_user "\nFAILURE Test C: Fewer tasks ($task_cnt) then expected ($expected_task_cnt)\n" - set exit_code 1 + send_user "\nFAILURE Test C: Fewer tasks ($task_cnt) then expected ($expected_task_cnt)\n" + set exit_code 1 } if {$task_cnt > $expected_task_cnt} { - send_user "\nFAILURE Test C: More tasks ($task_cnt) then expected ($expected_task_cnt)\n" - set exit_code 1 + send_user "\nFAILURE Test C: More tasks ($task_cnt) then expected ($expected_task_cnt)\n" + set exit_code 1 } # @@ -185,9 +186,9 @@ if {$task_cnt > $expected_task_cnt} { exec $scancel $jobid set spawn_id $salloc_spawn_id expect { - eof { - wait - } + eof { + wait + } } diff --git a/testsuite/expect/test18.30 b/testsuite/expect/test18.30 index 46d886a3bac21e41071ab5780303ad4585fd1656..cd7ccc34e73d384d1187b8d81fc8e4676b155c58 100755 --- a/testsuite/expect/test18.30 +++ b/testsuite/expect/test18.30 @@ -72,7 +72,7 @@ set job_id 0 set host_0 "" set host_1 "" set timeout $max_job_delay -spawn $salloc -N$node_cnt -t1 $slaunch -l -N1 $bin_printenv SLURM_NODEID +set salloc_pid [spawn $salloc -N$node_cnt -t1 $slaunch -l -N1 $bin_printenv SLURM_NODEID] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -94,7 +94,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } @@ -127,7 +127,7 @@ set host_1 "" set host_2 "" set host_3 "" set timeout $max_job_delay -spawn $salloc -N$node_cnt -t1 $slaunch -l -N3 $bin_printenv SLURM_NODEID +set salloc_pid [spawn $salloc -N$node_cnt -t1 $slaunch -l -N3 $bin_printenv SLURM_NODEID] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -155,7 +155,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } diff --git a/testsuite/expect/test18.31 b/testsuite/expect/test18.31 index 830802c77640788247ccc72385b914f8df3a9794..c03e942511b29678e3af087af8f5c40bf7c376e5 100755 --- a/testsuite/expect/test18.31 +++ b/testsuite/expect/test18.31 @@ -66,7 +66,7 @@ set host_2 "" set host_3 "" set job_id 0 set timeout $max_job_delay -spawn $salloc -N$node_cnt -t1 $slaunch -l $bin_hostname +set salloc_pid [spawn $salloc -N$node_cnt -t1 $slaunch -l $bin_hostname] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -99,7 +99,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } @@ -153,7 +153,7 @@ set host_1 "" set host_2 "" set job_id 0 set timeout $max_job_delay -spawn $salloc -N$node_cnt -t1 --nodelist=$all_nodes $slaunch -N2 --relative=1 -l $bin_hostname +set salloc_pid [spawn $salloc -N$node_cnt -t1 --nodelist=$all_nodes $slaunch -N2 --relative=1 -l $bin_hostname] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -181,7 +181,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } @@ -226,7 +226,7 @@ set host_0 "" set host_1 "" set job_id 0 set timeout $max_job_delay -spawn $salloc -N$node_cnt --nodelist=$all_nodes -t1 $slaunch -N1 --nodelist-byname=$include_node -l $bin_hostname +set salloc_pid [spawn $salloc -N$node_cnt --nodelist=$all_nodes -t1 $slaunch -N1 --nodelist-byname=$include_node -l $bin_hostname] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -244,7 +244,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } @@ -283,7 +283,7 @@ set host_0 "" set host_1 "" set job_id 0 set timeout $max_job_delay -spawn $salloc -N$node_cnt --nodelist=$all_nodes -t1 $slaunch -N1 --nodelist-byid=2 -l $bin_hostname +set salloc_pid [spawn $salloc -N$node_cnt --nodelist=$all_nodes -t1 $slaunch -N1 --nodelist-byid=2 -l $bin_hostname] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -301,7 +301,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } diff --git a/testsuite/expect/test18.33 b/testsuite/expect/test18.33 index 837341dc7d93bde4c5b02c743f2c8ff28bccf4dd..4034332999b00a0d052e3c8b4a2c7e1a0d836f37 100755 --- a/testsuite/expect/test18.33 +++ b/testsuite/expect/test18.33 @@ -52,7 +52,7 @@ set env(SLAUNCH_OVERCOMMIT) 1 # Spawn a job via slaunch using these environment variables # set matches 0 -spawn $salloc -N1 -t1 $slaunch $bin_hostname +set salloc_pid [spawn $salloc -N1 -t1 $slaunch $bin_hostname] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -77,7 +77,7 @@ expect { timeout { send_user "\nFAILURE: srun not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } diff --git a/testsuite/expect/test18.34 b/testsuite/expect/test18.34 index cbb7bb22ec1fea22a8ba4d0b9ccaec08d694796f..5b10a8c5508dfdd436770743ca2950be34643cfb 100755 --- a/testsuite/expect/test18.34 +++ b/testsuite/expect/test18.34 @@ -46,7 +46,7 @@ print_header $test_id # Change working directory on execute line and then print where jobs runs # set timeout $max_job_delay -spawn $salloc -N1 -t1 $slaunch --name=$step_name $scontrol show step +set salloc_pid [spawn $salloc -N1 -t1 $slaunch --name=$step_name $scontrol show step] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -63,7 +63,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } diff --git a/testsuite/expect/test18.35 b/testsuite/expect/test18.35 index 26edc25c6280f33db79b95187b510dd4d223ded6..9fd44c0ce66a97ed02ab875c7e00a58a60cd8edf 100755 --- a/testsuite/expect/test18.35 +++ b/testsuite/expect/test18.35 @@ -67,7 +67,7 @@ set host_2 "" set host_3 "" set job_id 0 set timeout $max_job_delay -spawn $salloc -N$node_cnt -t1 $slaunch -l $bin_hostname +set salloc_pid [spawn $salloc -N$node_cnt -t1 $slaunch -l $bin_hostname] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -100,7 +100,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } @@ -155,7 +155,7 @@ set host_1 "" set host_2 "" set job_id 0 set timeout $max_job_delay -spawn $salloc -N$node_cnt -t1 --nodelist=$all_nodes $slaunch -n2 --task-layout-byid=1,2 -l $bin_hostname +set salloc_pid [spawn $salloc -N$node_cnt -t1 --nodelist=$all_nodes $slaunch -n2 --task-layout-byid=1,2 -l $bin_hostname] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -187,7 +187,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } @@ -238,7 +238,7 @@ set host_0 "" set host_1 "" set job_id 0 set timeout $max_job_delay -spawn $salloc -N$node_cnt --nodelist=$all_nodes -t1 $slaunch -n1 --task-layout-byname=$include_node -l $bin_hostname +set salloc_pid [spawn $salloc -N$node_cnt --nodelist=$all_nodes -t1 $slaunch -n1 --task-layout-byname=$include_node -l $bin_hostname] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -256,7 +256,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } @@ -299,7 +299,7 @@ set host_0 "" set host_1 "" set job_id 0 set timeout $max_job_delay -spawn $salloc -N$node_cnt --nodelist=$all_nodes -t1 $slaunch -n1 --task-layout-file=$hostfile -l $bin_hostname +set salloc_pid [spawn $salloc -N$node_cnt --nodelist=$all_nodes -t1 $slaunch -n1 --task-layout-file=$hostfile -l $bin_hostname] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -317,7 +317,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } diff --git a/testsuite/expect/test18.36 b/testsuite/expect/test18.36 index 3eae51172cab429306e2df279a78ef9500820f59..1992542b4465577a22e52ed0adb6b696a98ac176 100755 --- a/testsuite/expect/test18.36 +++ b/testsuite/expect/test18.36 @@ -71,7 +71,7 @@ exec $bin_chmod 700 $file_prog # # Create an allocation # -spawn $salloc -N1 --verbose -t2 $bin_bash +set salloc_pid [spawn $salloc -N1 --verbose -t2 $bin_bash] expect { -re "Granted job allocation ($number)" { set jobid $expect_out(1,string) @@ -79,7 +79,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } @@ -478,7 +478,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding or failure to recognize prompt\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } diff --git a/testsuite/expect/test18.37 b/testsuite/expect/test18.37 index 3f4f7d1cde37a52d9495d214f6812101ab804722..e74ccfd2e35894eba5437d3e0d61f5ab06b9b1d5 100755 --- a/testsuite/expect/test18.37 +++ b/testsuite/expect/test18.37 @@ -81,7 +81,7 @@ exec $bin_chmod 700 $file_prog # # Create an allocation # -spawn $salloc -N1 --verbose -t2 $bin_bash +set salloc_pid [spawn $salloc -N1 --verbose -t2 $bin_bash] expect { -re "Granted job allocation ($number)" { set jobid $expect_out(1,string) @@ -89,7 +89,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } @@ -509,7 +509,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding or failure to recognize prompt\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } diff --git a/testsuite/expect/test18.38 b/testsuite/expect/test18.38 index fd9a28578950bd98702fa4e87223038494a4f507..433789f1a88a29dace0ba6fd5e0471fe2dddf197 100755 --- a/testsuite/expect/test18.38 +++ b/testsuite/expect/test18.38 @@ -43,14 +43,15 @@ set timeout $max_job_delay set salloc_pid [spawn $salloc -N1 $slaunch $bin_sleep 600] set salloc_sid $spawn_id expect { - -re "Granted job allocation ($number)" { - set jobid $expect_out(1,string) - } - timeout { - send_user "\nFAILURE: salloc failed to grab an allocation in a timely manner.\n" - exec kill $salloc_pid - exit 1 - } + -re "Granted job allocation ($number)" { + set jobid $expect_out(1,string) + } + timeout { + send_user "\nFAILURE: salloc failed to grab an allocation " + send_user "in a timely manner.\n" + exec kill $salloc_pid + exit 1 + } } # @@ -61,26 +62,26 @@ set pattern "xcoetn46398vnk" set got_pattern 0 set slaunch_pid [spawn $slaunch --jobid $jobid echo $pattern] expect { - -re "error" { - send_user "\nFAILURE: unexpected error occurred\n" - set exit_code 1 - } - -re $pattern { - set got_pattern 1 - exp_continue - } - timeout { - exec kill $slaunch_pid - exec kill -9 $slaunch_pid - } - eof { - wait - } + -re "error" { + send_user "\nFAILURE: unexpected error occurred\n" + set exit_code 1 + } + -re $pattern { + set got_pattern 1 + exp_continue + } + timeout { + exec kill $slaunch_pid + exec kill -9 $slaunch_pid + } + eof { + wait + } } if {$got_pattern == 0} { - send_user "\nFAILURE: unable to srun step under existing job allocation\n" - set exit_code 1 + send_user "\nFAILURE: unable to srun step under existing job allocation\n" + set exit_code 1 } # @@ -90,19 +91,19 @@ exec $scancel $jobid exec kill $salloc_pid set spawn_id $salloc_sid expect { - -re "error.*already completed" { - send_user "The \"already completed\" error is normal.\n" - exp_continue - } - timeout { - exec kill -9 $salloc_pid - } - eof { - wait - } + -re "error.*already completed" { + send_user "The \"already completed\" error is normal.\n" + exp_continue + } + timeout { + exec kill -9 $salloc_pid + } + eof { + wait + } } if {$got_pattern == 1} { - send_user "\nSUCCESS\n" + send_user "\nSUCCESS\n" } exit $exit_code diff --git a/testsuite/expect/test18.4 b/testsuite/expect/test18.4 index 3ff9f68dd6e7920b49d3d1b25891779476ec407f..b5075de264f03038b562c46995b3866118c32b05 100755 --- a/testsuite/expect/test18.4 +++ b/testsuite/expect/test18.4 @@ -42,7 +42,7 @@ for {set inx 1} {$inx < 8} {set inx [expr $inx * 2]} { set tasks_set $inx set tasks_get 0 set timeout $max_job_delay - spawn $salloc -N1-4 -t1 $slaunch -n$tasks_set --overcommit $bin_id + set salloc_pid [spawn $salloc -N1-4 -t1 $slaunch -n$tasks_set --overcommit $bin_id] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -55,7 +55,7 @@ for {set inx 1} {$inx < 8} {set inx [expr $inx * 2]} { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } diff --git a/testsuite/expect/test18.6 b/testsuite/expect/test18.6 index 911557550b865063f1b0901e2a252b6d9a555c53..1f6e6ebf6de492554f9d5bf4fbd1426d5e5d2703 100755 --- a/testsuite/expect/test18.6 +++ b/testsuite/expect/test18.6 @@ -42,7 +42,7 @@ print_header $test_id # Submit a slurm job that will execute 'id' on 1 node and over task_cnt tasks # set timeout $max_job_delay -spawn $salloc -N1 -t1 $slaunch -vv $bin_hostname +set salloc_pid [spawn $salloc -N1 -t1 $slaunch -vv $bin_hostname] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -59,7 +59,7 @@ expect { timeout { send_user "\nFAILURE: slurm not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } diff --git a/testsuite/expect/test18.7 b/testsuite/expect/test18.7 index 632ed6f93ec87d7bd5d1398f689c18554c229d15..e857a6f9b74a0ca5470fc51f76d47b7e170b51bb 100755 --- a/testsuite/expect/test18.7 +++ b/testsuite/expect/test18.7 @@ -45,7 +45,7 @@ print_header $test_id # set debug_offset [expr $debug_set - 2] set timeout $max_job_delay -spawn $salloc -N1 -t1 $slaunch -d$debug_offset /invalid_executable +set salloc_pid [spawn $salloc -N1 -t1 $slaunch -d$debug_offset /invalid_executable ] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -58,7 +58,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } diff --git a/testsuite/expect/test18.8 b/testsuite/expect/test18.8 index 82b9911b1b16e092dd56e36aa90280549c79b10d..94a87d565682d5da106a504e599d14cbc3ff6bea 100755 --- a/testsuite/expect/test18.8 +++ b/testsuite/expect/test18.8 @@ -49,7 +49,7 @@ exec $bin_touch $scratch_file # The --unbuffered option will send the message which lacks a '\n' # set timeout $max_job_delay -spawn $salloc -t1 $slaunch --unbuffered $bin_rm -i $scratch_file +set salloc_pid [spawn $salloc -t1 $slaunch --unbuffered $bin_rm -i $scratch_file] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -63,7 +63,7 @@ expect { timeout { send_user "\nFAILURE: slaunch not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } diff --git a/testsuite/expect/test18.9 b/testsuite/expect/test18.9 index c09f171bb2a9b2b9ba5dce5675df2fcf61210b25..98bfbeddc49287c5a81c62577ade4ae728aa54bf 100755 --- a/testsuite/expect/test18.9 +++ b/testsuite/expect/test18.9 @@ -55,7 +55,7 @@ make_bash_script $file_in " # Spawn tasks via slaunch and immediately exit task 1 only # set timeout $max_job_delay -spawn $salloc -N1 -t2 $slaunch -n10 --overcommit -W2 $file_in +set salloc_pid [spawn $salloc -N1 -t2 $slaunch -n10 --overcommit -W2 $file_in] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -73,7 +73,7 @@ expect { timeout { send_user "\nFAILURE: slaunch not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id } diff --git a/testsuite/expect/test6.12 b/testsuite/expect/test6.12 index 97f1714ee2b7d0a21ac879930ce7665b37268555..ad62230c8d18a61244c394c9ee923abf01488e0f 100755 --- a/testsuite/expect/test6.12 +++ b/testsuite/expect/test6.12 @@ -63,12 +63,12 @@ $srun $bin_sleep 500 & trap /bin/true SIGINT while /bin/true; do - wait - if \[ \$? -ge 128 \]; then - echo \"INTerrupted wait, resuming\" - else - break - fi + wait + if \[ \$? -ge 128 \]; then + echo \"INTerrupted wait, resuming\" + else + break + fi done " diff --git a/testsuite/expect/test7.2 b/testsuite/expect/test7.2 index a2e75f893707ffc1d7181ed2c978961c9d3baafd..d6f636163988988f63ed2601b77dc40bb1a7a93f 100755 --- a/testsuite/expect/test7.2 +++ b/testsuite/expect/test7.2 @@ -95,7 +95,7 @@ expect { # times are here vv set timeout [expr $max_job_delay + 60] set job_id 0 -spawn $salloc -N$node_cnt -t1 $slaunch -n8 --overcommit -l --pmi-threads=3 $file_prog_get +set salloc_pid [spawn $salloc -N$node_cnt -t1 $slaunch -n8 --overcommit -l --pmi-threads=3 $file_prog_get] expect { -re "Granted job allocation ($number)" { set job_id $expect_out(1,string) @@ -114,7 +114,7 @@ expect { timeout { send_user "\nFAILURE: salloc not responding\n" if {$job_id == 0} { - kill_salloc + slow_kill $salloc_pid } else { cancel_job $job_id }