diff --git a/testsuite/expect/test18.10 b/testsuite/expect/test18.10
index 4af7f67ae05aecb7e4e4ed0c09cce9a9f4b0baeb..0e4dff0e5041f7d42af17ae602fe59378122563d 100755
--- a/testsuite/expect/test18.10
+++ b/testsuite/expect/test18.10
@@ -60,13 +60,11 @@ 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 [expr 0 - $salloc_pid]
 		set exit_code 1
-		exp_continue
 	}
 	eof {
 		wait
@@ -96,13 +94,11 @@ 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 [expr 0 - $salloc_pid]
 		set exit_code 1
-		exp_continue
 	}
 	eof {
 		wait
diff --git a/testsuite/expect/test18.11 b/testsuite/expect/test18.11
index 9d17e707a518fb3ed9f10c9c53a3a6456bcf91aa..23360c4d5a94d793a339ec3d37b9550936145c14 100755
--- a/testsuite/expect/test18.11
+++ b/testsuite/expect/test18.11
@@ -59,13 +59,11 @@ 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 [expr 0 - $salloc_pid]
 		set exit_code 1
-		exp_continue
 	}
 	eof {
 		wait
@@ -110,11 +108,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 [expr 0 - $salloc_pid]
 		exit 1
 	}
 	eof {
@@ -151,11 +148,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 [expr 0 - $salloc_pid]
 		exit 1
 	}
 	eof {
@@ -192,11 +188,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 [expr 0 - $salloc_pid]
 		exit 1
 	}
 	eof {
diff --git a/testsuite/expect/test18.12 b/testsuite/expect/test18.12
index 8c6dae9ec9da054e22404a61164c000aeee8c201..c80b19a1698823a50c8b636bfac32465eeacb02a 100755
--- a/testsuite/expect/test18.12
+++ b/testsuite/expect/test18.12
@@ -68,13 +68,11 @@ 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 [expr 0 - $salloc_pid]
 		set exit_code 1
-		exp_continue
 	}
 	eof {
 		wait
diff --git a/testsuite/expect/test18.13 b/testsuite/expect/test18.13
index b93a54adecc44db63f1855de0775ea610105a5e0..6ec5d099bc8563e41f826f7aa6663e8f469984e8 100755
--- a/testsuite/expect/test18.13
+++ b/testsuite/expect/test18.13
@@ -63,13 +63,11 @@ 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 [expr 0 - $salloc_pid]
 		set exit_code 1
-		exp_continue
 	}
 	eof {
 		wait
diff --git a/testsuite/expect/test18.14 b/testsuite/expect/test18.14
index 335d2d86173cc1f1c9811fb2dbbfb300b450fa9f..4deb481f5d51564c97394da5810323bcb1237a2c 100755
--- a/testsuite/expect/test18.14
+++ b/testsuite/expect/test18.14
@@ -81,13 +81,11 @@ 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 [expr 0 - $salloc_pid]
 		set exit_code 1
-		exp_continue
 	}
 	eof {
 		wait
diff --git a/testsuite/expect/test18.15 b/testsuite/expect/test18.15
index 99fae481dc4aa2467af3746f4f61e09c35c79d48..1afbaf2cb904b3bdb810148e4796306cce6b266d 100755
--- a/testsuite/expect/test18.15
+++ b/testsuite/expect/test18.15
@@ -62,13 +62,11 @@ 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 [expr 0 - $salloc_pid]
 		set exit_code 1
-		exp_continue
 	}
 	eof {
 		wait
diff --git a/testsuite/expect/test18.16 b/testsuite/expect/test18.16
index 248585327bb60cd1719ee1c4cf7032cc5769ca10..54e10c11ff78b15ddfb80bef9cf667b853c8f73f 100755
--- a/testsuite/expect/test18.16
+++ b/testsuite/expect/test18.16
@@ -171,13 +171,11 @@ 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 [expr 0 - $salloc_pid]
 		set exit_code 1
-		exp_continue
 	}
 	eof {
 		wait
diff --git a/testsuite/expect/test18.17 b/testsuite/expect/test18.17
index 1b95e1b3c91bb4620d956a693c29a00cde4aebfe..782468a9fc7a74f68115692d61d01c73367aab2d 100755
--- a/testsuite/expect/test18.17
+++ b/testsuite/expect/test18.17
@@ -60,11 +60,12 @@ expect {
 		set job_id $expect_out(1,string)
 	}
 	timeout {
-		if {$job_id == 0} {
-			slow_kill $salloc_pid
-		} else {
+		if {$job_id != 0} {
 			cancel_job $job_id
 		}
+		slow_kill [expr 0 - $salloc_pid]
+		send_user "\nFAILURE: salloc not responding\n"
+		exit 1
 	}
 }
 
diff --git a/testsuite/expect/test18.18 b/testsuite/expect/test18.18
index f9ff98eb957deb5bbc8d1f83d0ea19c9a4263505..a607c0dfc8ba104feb8f3b9520db77872bde9609 100755
--- a/testsuite/expect/test18.18
+++ b/testsuite/expect/test18.18
@@ -72,13 +72,11 @@ 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 [expr 0 - $salloc_pid]
 		set exit_code 1
-		exp_continue
 	}
 	eof {
 		wait
diff --git a/testsuite/expect/test18.19 b/testsuite/expect/test18.19
index 99e4c52798aea48e5aade2ccf6d72cbfae749f80..263dcbd12ae28df69d8fcd3ef203995fbbe45873 100755
--- a/testsuite/expect/test18.19
+++ b/testsuite/expect/test18.19
@@ -7,9 +7,6 @@
 # Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
 #          "FAILURE: ..." otherwise with an explanation of the failure, OR
 #          anything else indicates a failure mode that must be investigated.
-#
-# Note:    This script generates and then deletes files in the working directory
-#          named test18.19.prog
 ############################################################################
 # Copyright (C) 2002-2006 The Regents of the University of California.
 # Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -117,13 +114,11 @@ 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 [expr 0 - $salloc_pid]
 		set exit_code 1
-		exp_continue
 	}
 	eof {
 		send_user "\nEOF\n"
diff --git a/testsuite/expect/test18.21 b/testsuite/expect/test18.21
index cac6054a0abcfc77164e3a4fc2e1d754158425c4..3295b9d8440aef0c605c706e053b0513bbd4f471 100755
--- a/testsuite/expect/test18.21
+++ b/testsuite/expect/test18.21
@@ -91,13 +91,11 @@ 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_1
 		}
+		slow_kill [expr 0 - $salloc_pid]
 		set exit_code 1
-		exp_continue
 	}
 	eof {
 		wait
diff --git a/testsuite/expect/test18.22 b/testsuite/expect/test18.22
index 71048c5b930628a08e8e2ce56e228fb1dfe798c3..3a4db5d8db92aa2bd3ac75defc3c94a538536eee 100755
--- a/testsuite/expect/test18.22
+++ b/testsuite/expect/test18.22
@@ -99,13 +99,11 @@ 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 [expr 0 - $salloc_pid]
 		set exit_code 1
-		exp_continue
 	}
 	eof {
 		wait
diff --git a/testsuite/expect/test18.23 b/testsuite/expect/test18.23
index 2d2d7b76f556ba6a5100d6bfa6f572f593dd392b..03ef80a1353ff94636650b2b140c7662acd542d6 100755
--- a/testsuite/expect/test18.23
+++ b/testsuite/expect/test18.23
@@ -60,13 +60,11 @@ 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 [expr 0 - $salloc_pid]
 		set exit_code 1
-		exp_continue
 	}
 	eof {
 		wait
diff --git a/testsuite/expect/test18.25 b/testsuite/expect/test18.25
index b4a12db53ce1b90fd3d4d5f0a35a5b21a4678ce5..641f5dad25569e73349ebc2ba7686eb8e68be080 100755
--- a/testsuite/expect/test18.25
+++ b/testsuite/expect/test18.25
@@ -66,11 +66,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 [expr 0 - $salloc_pid]
 		exit 1
 	}
 }
diff --git a/testsuite/expect/test18.26 b/testsuite/expect/test18.26
index ff064dc80d8b5b59d72330a543b57242f1f60584..dc5359ba380b0394087231b0e90bcb597dbb912d 100755
--- a/testsuite/expect/test18.26
+++ b/testsuite/expect/test18.26
@@ -87,13 +87,11 @@ 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 [expr 0 - $salloc_pid]
 		set exit_code 1
-		exp_continue
 	}
 	eof {
 		wait
@@ -150,13 +148,11 @@ 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 [expr 0 - $salloc_pid]
 		set exit_code 1
-		exp_continue
 	}
 	eof {
 		wait
diff --git a/testsuite/expect/test18.27 b/testsuite/expect/test18.27
index fb98e0ff84b9cba2a66c7385aeca2dbee77f3d93..fee0f85df54f9a76aa637164f9ed61e7c8c63992 100755
--- a/testsuite/expect/test18.27
+++ b/testsuite/expect/test18.27
@@ -68,13 +68,11 @@ 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 [expr 0 - $salloc_pid]
 		set exit_code 1
-		exp_continue
 	}
 	eof {
 		wait
@@ -116,13 +114,11 @@ 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 [expr 0 - $salloc_pid]
 		set exit_code 1
-		exp_continue
 	}
 	eof {
 		wait
diff --git a/testsuite/expect/test18.28 b/testsuite/expect/test18.28
index 7a8397a1119b3c5c5cad2dec62a7f7e50d706aff..0c77a24a292c532e56efe0e67c3fe5b351fbad8d 100755
--- a/testsuite/expect/test18.28
+++ b/testsuite/expect/test18.28
@@ -78,11 +78,10 @@ for {set inx 1} {$inx <= 4} {set inx [expr $inx * 2]} {
 		}
 		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 [expr 0 - $salloc_pid]
 			exit 1
 		}
 		eof {
diff --git a/testsuite/expect/test18.29 b/testsuite/expect/test18.29
index bc3f4356b23c31e3f2669bd1d9899eb1169eae86..c22d1ce26a90f0fdc618bf935b2ffa25647ee440 100755
--- a/testsuite/expect/test18.29
+++ b/testsuite/expect/test18.29
@@ -77,8 +77,12 @@ expect {
 		set jobid $expect_out(1,string)
 	}
 	timeout {
-		slow_kill $salloc_pid
-		set exit_code 1
+		send_user "\nFAILURE: salloc not responding\n"
+		if {$job_id != 0} {
+			cancel_job $job_id
+		}
+		slow_kill [expr 0 - $salloc_pid]
+		exit 1
 	}
 }
 expect {
@@ -86,8 +90,10 @@ expect {
 		set cpu_cnt $expect_out(1,string)
 	}
 	timeout {
-		slow_kill $salloc_pid
-		set exit_code 1
+		send_user "\nFAILURE: salloc not responding\n"
+		cancel_job $job_id
+		slow_kill [expr 0 - $salloc_pid]
+		exit 1
 	}
 }
 file delete $script_name
diff --git a/testsuite/expect/test18.30 b/testsuite/expect/test18.30
index cd7ccc34e73d384d1187b8d81fc8e4676b155c58..d7140e8e00565845961cfdbafd73d2fc235db06c 100755
--- a/testsuite/expect/test18.30
+++ b/testsuite/expect/test18.30
@@ -93,13 +93,11 @@ 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 [expr 0 - $salloc_pid]
 		set exit_code 1
-		exp_continue
 	}
 	eof {
 		wait
@@ -154,13 +152,11 @@ 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 [expr 0 - $salloc_pid]
 		set exit_code 1
-		exp_continue
 	}
 	eof {
 		wait
diff --git a/testsuite/expect/test18.31 b/testsuite/expect/test18.31
index c03e942511b29678e3af087af8f5c40bf7c376e5..3aefc8f25889b6824fc807b7e4037c20db7a3595 100755
--- a/testsuite/expect/test18.31
+++ b/testsuite/expect/test18.31
@@ -98,11 +98,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 [expr 0 - $salloc_pid]
 		exit 1
 	}
 	eof {
@@ -180,11 +179,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 [expr 0 - $salloc_pid]
 		exit 1
 	}
 	eof {
@@ -243,13 +241,11 @@ 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 [expr 0 - $salloc_pid]
 		set exit_code 1
-		exp_continue
 	}
 	eof {
 		wait
@@ -300,13 +296,11 @@ 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 [expr 0 - $salloc_pid]
 		set exit_code 1
-		exp_continue
 	}
 	eof {
 		wait
diff --git a/testsuite/expect/test18.33 b/testsuite/expect/test18.33
index 4034332999b00a0d052e3c8b4a2c7e1a0d836f37..32682395dfcd2e2c3b0eee641c5054a490c39d27 100755
--- a/testsuite/expect/test18.33
+++ b/testsuite/expect/test18.33
@@ -76,13 +76,11 @@ expect {
 	}
 	timeout {
 		send_user "\nFAILURE: srun not responding\n"
-		if {$job_id == 0} {
-			slow_kill $salloc_pid
-		} else {
+		if {$job_id != 0} {
 			cancel_job $job_id
 		}
+		slow_kill [expr 0 - $salloc_pid]
 		set exit_code 1
-		exp_continue
 	}
 	eof {
 		wait
diff --git a/testsuite/expect/test18.34 b/testsuite/expect/test18.34
index 5b10a8c5508dfdd436770743ca2950be34643cfb..cfafd57660edabdfa638277e9e1280f9c9fecb7f 100755
--- a/testsuite/expect/test18.34
+++ b/testsuite/expect/test18.34
@@ -62,13 +62,11 @@ 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 [expr 0 - $salloc_pid]
 		set exit_code 1
-		exp_continue
 	}
 	eof {
 		wait
diff --git a/testsuite/expect/test18.35 b/testsuite/expect/test18.35
index 9fd44c0ce66a97ed02ab875c7e00a58a60cd8edf..d34e82bb984eabf92330c3c765dc9b1f78d0c301 100755
--- a/testsuite/expect/test18.35
+++ b/testsuite/expect/test18.35
@@ -99,11 +99,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 [expr 0 - $salloc_pid]
 		exit 1
 	}
 	eof {
@@ -186,11 +185,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 [expr 0 - $salloc_pid]
 		exit 1
 	}
 	eof {
@@ -255,13 +253,11 @@ 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 [expr 0 - $salloc_pid]
 		set exit_code 1
-		exp_continue
 	}
 	eof {
 		wait
@@ -316,13 +312,11 @@ 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 [expr 0 - $salloc_pid]
 		set exit_code 1
-		exp_continue
 	}
 	eof {
 		wait
diff --git a/testsuite/expect/test18.36 b/testsuite/expect/test18.36
index 1992542b4465577a22e52ed0adb6b696a98ac176..f9f652d5c583d7f6cbc50b57e0409501ec6e6768 100755
--- a/testsuite/expect/test18.36
+++ b/testsuite/expect/test18.36
@@ -78,11 +78,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 [expr 0 - $salloc_pid]
 		exit 1
 	}
 }
@@ -477,11 +476,10 @@ expect {
 	}
 	timeout {
 		send_user "\nFAILURE: salloc not responding or failure to recognize prompt\n"
-		if {$job_id == 0} {
-			slow_kill $salloc_pid
-		} else {
+		if {$job_id != 0} {
 			cancel_job $job_id
 		}
+		slow_kill [expr 0 - $salloc_pid]
 		set exit_code 1
 	}
 	eof {
diff --git a/testsuite/expect/test18.37 b/testsuite/expect/test18.37
index e74ccfd2e35894eba5437d3e0d61f5ab06b9b1d5..b0f95365e93970c9e128549edb415f662f65a2a3 100755
--- a/testsuite/expect/test18.37
+++ b/testsuite/expect/test18.37
@@ -88,11 +88,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 [expr 0 - $salloc_pid]
 		exit 1
 	}
 }
@@ -508,11 +507,10 @@ expect {
 	}
 	timeout {
 		send_user "\nFAILURE: salloc not responding or failure to recognize prompt\n"
-		if {$job_id == 0} {
-			slow_kill $salloc_pid
-		} else {
+		if {$job_id != 0} {
 			cancel_job $job_id
 		}
+		slow_kill [expr 0 - $salloc_pid]
 		set exit_code 1
 	}
 	eof {
diff --git a/testsuite/expect/test18.38 b/testsuite/expect/test18.38
index 433789f1a88a29dace0ba6fd5e0471fe2dddf197..7a8d654d89dc504bdc86b23b7abdb39fd80193a9 100755
--- a/testsuite/expect/test18.38
+++ b/testsuite/expect/test18.38
@@ -49,7 +49,10 @@ expect {
 	timeout {
 		send_user "\nFAILURE: salloc failed to grab an allocation "
 		send_user "in a timely manner.\n"
-		exec kill $salloc_pid
+		if {$job_id != 0} {
+			cancel_job $job_id
+		}
+		slow_kill [expr 0 - $salloc_pid]
 		exit 1
 	}
 }
diff --git a/testsuite/expect/test18.4 b/testsuite/expect/test18.4
index b5075de264f03038b562c46995b3866118c32b05..f3bd0fd45f342cfe7c964f0c1a81c34d1001c0aa 100755
--- a/testsuite/expect/test18.4
+++ b/testsuite/expect/test18.4
@@ -54,13 +54,11 @@ for {set inx 1} {$inx < 8} {set inx [expr $inx * 2]} {
 		}
 		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 [expr 0 - $salloc_pid]
 			set exit_code 1
-			exp_continue
 		}
 		eof {
 			if {$tasks_get < $tasks_set} {
diff --git a/testsuite/expect/test18.5 b/testsuite/expect/test18.5
index aebb4eca4b4b3b373d123cbbb174af4620341bff..c3aa4306862ac19358badc62ddb4075e05b8e15f 100755
--- a/testsuite/expect/test18.5
+++ b/testsuite/expect/test18.5
@@ -60,18 +60,25 @@ exec $bin_chmod 700 $file_in
 #
 # Spawn a shell via slaunch that uses stdin/out/err and confirm their contents
 #
+set job_id  0
 set timeout $max_job_delay
 set salloc_pid [spawn $salloc -N1 -t1 $slaunch --slaunch-input=$file_in --slaunch-output=$file_out --slaunch-error=$file_err $bin_bash]
 expect {
+	-re "Granted job allocation ($number)" {
+		set job_id $expect_out(1,string)
+		exp_continue
+	}
 	-re "Unable to contact" {
 		send_user "\nFAILURE: slurm appears to be down\n"
 		exit 1
 	}
 	timeout {
 		send_user "\nFAILURE: salloc/slaunch not responding\n"
-		exec $bin_kill -TERM "-$salloc_pid"
+		if {$job_id != 0} {
+			cancel_job $job_id
+		}
+		slow_kill [expr 0 - $salloc_pid]
 		set exit_code 1
-		exp_continue
 	}
 	eof {
 		wait
@@ -148,8 +155,13 @@ if {$got_sleep_err == 0} {
 #
 # Spawn a program to run for a while with no input, output or error
 #
+set job_id 0
 set salloc_pid [spawn $salloc -N1 -t1 $slaunch --slaunch-input=none --slaunch-output=none --slaunch-error=none $bin_od -c $srun]
 expect {
+	-re "Granted job allocation ($number)" {
+		set job_id $expect_out(1,string)
+		exp_continue
+	}
 	-re "Unable to contact" {
 		send_user "\nFAILURE: slurm appears to be down\n"
 		exit 1
@@ -165,7 +177,10 @@ expect {
 		exp_continue
 	}
 	timeout {
-		send_user "\nFAILURE: srun not responding\n"
+		send_user "\nFAILURE: salloc not responding\n"
+		if {$job_id != 0} {
+			cancel_job $job_id
+		}
 		slow_kill [expr 0 - $salloc_pid]
 		set exit_code 1
 	}
diff --git a/testsuite/expect/test18.6 b/testsuite/expect/test18.6
index 1f6e6ebf6de492554f9d5bf4fbd1426d5e5d2703..cb06448cf22767acce0557693879a0ddfde488e2 100755
--- a/testsuite/expect/test18.6
+++ b/testsuite/expect/test18.6
@@ -58,13 +58,11 @@ expect {
 	}
 	timeout {
 		send_user "\nFAILURE: slurm not responding\n"
-		if {$job_id == 0} {
-			slow_kill $salloc_pid
-		} else {
+		if {$job_id != 0} {
 			cancel_job $job_id
 		}
+		slow_kill [expr 0 - $salloc_pid]
 		set exit_code 1
-		exp_continue
 	}
 	eof {
 		wait
diff --git a/testsuite/expect/test18.7 b/testsuite/expect/test18.7
index e857a6f9b74a0ca5470fc51f76d47b7e170b51bb..413ae13808d40d1284a46545ee2ad0d17e9bba23 100755
--- a/testsuite/expect/test18.7
+++ b/testsuite/expect/test18.7
@@ -57,13 +57,11 @@ 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 [expr 0 - $salloc_pid]
 		set exit_code 1
-		exp_continue
 	}
 }
 
diff --git a/testsuite/expect/test18.8 b/testsuite/expect/test18.8
index 94a87d565682d5da106a504e599d14cbc3ff6bea..4b26773b80f1e269c78cde067f9ee58a0e32c6f6 100755
--- a/testsuite/expect/test18.8
+++ b/testsuite/expect/test18.8
@@ -62,13 +62,11 @@ expect {
 	}
 	timeout {
 		send_user "\nFAILURE: slaunch not responding\n"
-		if {$job_id == 0} {
-			slow_kill $salloc_pid
-		} else {
+		if {$job_id != 0} {
 			cancel_job $job_id
 		}
+		slow_kill [expr 0 - $salloc_pid]
 		set exit_code 1
-		exp_continue
 	}
 	eof {
 		wait
diff --git a/testsuite/expect/test18.9 b/testsuite/expect/test18.9
index 98bfbeddc49287c5a81c62577ade4ae728aa54bf..336c882594a45d89d58bc625f3f7a4cc740ad5ec 100755
--- a/testsuite/expect/test18.9
+++ b/testsuite/expect/test18.9
@@ -72,13 +72,11 @@ expect {
 	}
 	timeout {
 		send_user "\nFAILURE: slaunch not responding\n"
-		if {$job_id == 0} {
-			slow_kill $salloc_pid
-		} else {
+		if {$job_id != 0} {
 			cancel_job $job_id
 		}
+		slow_kill [expr 0 - $salloc_pid]
 		set exit_code 1
-		exp_continue
 	}
 	eof {
 		wait