diff --git a/testsuite/expect/test1.1 b/testsuite/expect/test1.1 index 4787920a2ed65f0cd565faab69242c5a6076d72c..c4dc9727633a5ec451f9bb4fb61b7daab4728709 100755 --- a/testsuite/expect/test1.1 +++ b/testsuite/expect/test1.1 @@ -70,7 +70,7 @@ if {$got_login_grps == 0} { # Submit a slurm job that will execute 'id' # set timeout $max_job_delay -spawn $srun -N1 -t1 $bin_id +set srun_pid [spawn $srun -N1 -t1 $bin_id] expect { -re "(uid=.*\n)" { set job_grp_info $expect_out(1,string) @@ -79,7 +79,7 @@ expect { } timeout { send_user "\nFAILURE: srun not responding\n" - kill_srun + slow_kill $srun_pid set exit_code 1 exp_continue } diff --git a/testsuite/expect/test1.2 b/testsuite/expect/test1.2 index 43302bb3bbe38365a6adcb1a1c7c39687cceb918..d6b90a0a487a34bb0d8efbdf87db348917b550dd 100755 --- a/testsuite/expect/test1.2 +++ b/testsuite/expect/test1.2 @@ -43,7 +43,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 $srun -N1 -n$task_cnt --overcommit -l -t1 $bin_id +set srun_pid [spawn $srun -N1 -n$task_cnt --overcommit -l -t1 $bin_id] expect { -re "uid=" { incr tasks @@ -51,7 +51,7 @@ expect { } timeout { send_user "\nFAILURE: srun not responding\n" - kill_srun + slow_kill $srun_pid set exit_code 1 exp_continue } diff --git a/testsuite/expect/test1.3 b/testsuite/expect/test1.3 index 9e037a53494bb20d35543d0908b8a68f701c7df7..23838281a66e2277f4c8463e5d03a9ac78cc0227 100755 --- a/testsuite/expect/test1.3 +++ b/testsuite/expect/test1.3 @@ -40,7 +40,7 @@ print_header $test_id # # Report the srun version number # -spawn $srun -V +set srun_pid [spawn $srun -V] expect { -re "(slurm ($number)\.($number)\.($number).*\n)" { incr version @@ -48,7 +48,7 @@ expect { } timeout { send_user "\nFAILURE: srun not responding\n" - kill_srun + slow_kill $srun_pid set exit_code 1 exp_continue } diff --git a/testsuite/expect/test1.4 b/testsuite/expect/test1.4 index b8297109807a9cf218896afba546cb1439f56e9e..177f1edb896ccb6388b6e66d8166016c3ab7f9f2 100755 --- a/testsuite/expect/test1.4 +++ b/testsuite/expect/test1.4 @@ -40,7 +40,7 @@ print_header $test_id # # Report the srun usage format # -spawn $srun --usage +set srun_pid [spawn $srun --usage] expect { -re "Usage: .* executable .*" { incr matches @@ -48,7 +48,7 @@ expect { } timeout { send_user "\nFAILURE: srun not responding\n" - kill_srun + slow_kill $srun_pid set exit_code 1 exp_continue } diff --git a/testsuite/expect/test1.5 b/testsuite/expect/test1.5 index 4d03930aba247c2ca7c763e4f8ea8877eca0ae85..179da4a4245ee7ceea5a58e4b0614a7cf0ea04da 100755 --- a/testsuite/expect/test1.5 +++ b/testsuite/expect/test1.5 @@ -40,7 +40,7 @@ print_header $test_id # # Report the srun help message # -spawn $srun --help +set srun_pid [spawn $srun --help] expect { -re "Usage:" { incr matches @@ -56,7 +56,7 @@ expect { } timeout { send_user "\nFAILURE: srun not responding\n" - kill_srun + slow_kill $srun_pid set exit_code 1 exp_continue } diff --git a/testsuite/expect/test1.6 b/testsuite/expect/test1.6 index 86ba387255c43d8124e736db96f966d45173b473..2863c290832dfc5c834d4c009a2d3bb7074a801d 100755 --- a/testsuite/expect/test1.6 +++ b/testsuite/expect/test1.6 @@ -45,7 +45,7 @@ print_header $test_id # Change working directory on execute line and then print where jobs runs # set timeout $max_job_delay -spawn $srun --chdir=$tmp_dir -t1 $bin_pwd +set srun_pid [spawn $srun --chdir=$tmp_dir -t1 $bin_pwd] expect { -re "$tmp_dir$end_of_line" { set matches 1 @@ -57,7 +57,7 @@ expect { } timeout { send_user "\nFAILURE: srun not responding\n" - kill_srun + slow_kill $srun_pid set exit_code 1 exp_continue } diff --git a/testsuite/expect/test15.4 b/testsuite/expect/test15.4 index 19e81d6f6134a58de15d4b7631679c96660821df..af727668bc702614c1e5edba56f2e87796d57993 100755 --- a/testsuite/expect/test15.4 +++ b/testsuite/expect/test15.4 @@ -84,11 +84,10 @@ expect { } timeout { send_user "\nFAILURE: salloc not responding\n" - if {$job_id == 0} { - slow_kill $salloc_pid - } else { + if {$job_id != 0} { cancel_job $job_id } + slow_kill $salloc_pid set exit_code 1 exp_continue } diff --git a/testsuite/expect/test15.5 b/testsuite/expect/test15.5 index 8a39701a466b28ae1a602d1a06f3274486334030..3f90be30672f60584dd2f7a5b9e3c946667cce57 100755 --- a/testsuite/expect/test15.5 +++ b/testsuite/expect/test15.5 @@ -116,11 +116,10 @@ expect { } timeout { send_user "\nFAILURE: salloc not responding\n" - if {$job_id == 0} { - slow_kill $salloc_pid - } else { + if {$job_id != 0} { cancel_job $job_id } + slow_kill $salloc_pid set exit_code 1 exp_continue } @@ -143,11 +142,10 @@ expect { } timeout { send_user "\nFAILURE: salloc not responding\n" - if {$job_id == 0} { - slow_kill $salloc_pid - } else { + if {$job_id != 0} { cancel_job $job_id } + slow_kill $salloc_pid set exit_code 1 exp_continue } diff --git a/testsuite/expect/test15.7 b/testsuite/expect/test15.7 index 16d7069ea7f58943064b89ef4fc0a947ed5b478e..328383ff48424cc926dc253db782f63e3cdf1e35 100755 --- a/testsuite/expect/test15.7 +++ b/testsuite/expect/test15.7 @@ -60,11 +60,10 @@ expect { } timeout { send_user "\nFAILURE: salloc not responding\n" - if {$job_id == 0} { - slow_kill $salloc_pid - } else { + if {$job_id != 0} { cancel_job $job_id - ] + } + slow_kill $salloc_pid set exit_code 1 exp_continue }