Skip to content
Snippets Groups Projects
Commit 1ff12757 authored by Morris Jette's avatar Morris Jette
Browse files

Make db limits test more robust

Also make wait_for_job in the global tests file more robust by
checking for a zero job ID
parent bc2acff5
No related branches found
No related tags found
No related merge requests found
......@@ -555,11 +555,16 @@ proc wait_for_job { job_id desired_state } {
"DONE" {}
"RUNNING" {}
default {
send_user "Unsupported desired state: $desired_state\n"
send_user "FAILURE: wait_for_job with invalid state: $desired_state\n"
return 1
}
}
if {$job_id == 0} {
send_user "FAILURE: wait_for_job with invalid job ID: $job_id\n"
return 1
}
set sleep_time 1
set my_delay 0
while 1 {
......
......@@ -112,20 +112,17 @@ proc srun_test {exp_cnt account} {
wait
}
}
if {$count != $exp_cnt} {
send_user "\nFAILURE: incorrect number of jobs were ran $count != $exp_cnt\n"
set exit_code 1
}
if {$job_id == 0} {
send_user "\nFAILURE: did not get job id\n"
return -1
} else {
send_user "\nFAILURE: did not get job ID\n"
set exit_code 1
return $job_id
}
if {$count != $exp_cnt} {
send_user "\nFAILURE: incorrect number of tasks were run ($count != $exp_cnt)\n"
set exit_code 1
}
return $job_id
}
proc add_child {parent child maxnode grpnode} {
......@@ -294,7 +291,8 @@ cleanup
if {$exit_code == 0} {
send_user "\nSUCCESS\n"
} else {
send_user "\nFAILURE\n"
}
exit $exit_code
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