Skip to content
Snippets Groups Projects
Commit e7111f1c authored by jette's avatar jette
Browse files

Fix test for output order independence

parent 3c42f270
No related branches found
No related tags found
No related merge requests found
...@@ -89,18 +89,17 @@ if {$error_match != 2} { ...@@ -89,18 +89,17 @@ if {$error_match != 2} {
} }
# Run script with srun # Run script with srun
# Note the "Segmentation fault" and "exit_code" messages can come in any order
# Expect seems to have some trouble exiting if the "exit_code" comes first
set error_match 0 set error_match 0
set timeout $max_job_delay set timeout $max_job_delay
spawn $srun -n1 ./$script spawn $srun -n1 ./$script
expect { expect {
-re "Segmentation fault" { -re "(Segmentation|exit_code = $err_num_c)" {
send_user "\nThis error is expected\n"
incr error_match
exp_continue
}
-re "exit_code = ($number)" {
set err_num_srun $expect_out(1,string)
incr error_match incr error_match
if {$error_match != 2} {
exp_continue
}
} }
timeout { timeout {
send_user "\nFAILURE: srun is not responding\n" send_user "\nFAILURE: srun is not responding\n"
...@@ -114,12 +113,8 @@ expect { ...@@ -114,12 +113,8 @@ expect {
if {$error_match != 2} { if {$error_match != 2} {
send_user "\nFAILURE: srun did not have a segmentation error when runnning the program ($error_match != 2)\n" send_user "\nFAILURE: srun did not have a segmentation error when runnning the program ($error_match != 2)\n"
set exit_code 1 set exit_code 1
} } else {
send_user "\nThis error is expected\n"
# Match exit codes from both programs
if {$err_num_c != $err_num_srun} {
send_user "\nFAILURE: exit codes do not match ($err_num_c != $err_num_srun)\n"
set exit_code
} }
if {$exit_code == 0} { if {$exit_code == 0} {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment