Skip to content
Snippets Groups Projects
Commit ae53b836 authored by Albert Gil's avatar Albert Gil
Browse files

Testsuite - Improve performance of cancel_job calling scancel just once


Bug 10439

Signed-off-by: default avatarScott Jackson <scottmo@schedmd.com>
parent a1ab6e64
No related branches found
No related tags found
No related merge requests found
...@@ -1174,16 +1174,19 @@ proc run_command_status args { ...@@ -1174,16 +1174,19 @@ proc run_command_status args {
proc cancel_job { job_id_list {het_job 0}} { proc cancel_job { job_id_list {het_job 0}} {
global scancel global scancel
set job_list_clean [list]
foreach job_id $job_id_list { foreach job_id $job_id_list {
if {$job_id == 0} { if {$job_id != 0} {
continue lappend job_list_clean $job_id
} }
}
log_debug "Cancelling $job_id" log_debug "Cancelling $job_list_clean"
if {[run_command_status "$scancel -Q $job_id"]} { if {[run_command_status "$scancel -Q $job_list_clean"]} {
log_warn "scancel command returned error" log_warn "scancel command returned error"
return $::RETURN_ERROR return $::RETURN_ERROR
} }
foreach job_id $job_list_clean {
if {[wait_for_job $job_id "DONE" $het_job]} { if {[wait_for_job $job_id "DONE" $het_job]} {
log_warn "Job $job_id not ended" log_warn "Job $job_id not ended"
return $::RETURN_ERROR return $::RETURN_ERROR
......
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