Skip to content

Commit 004ce7a

Browse files
committed
use scontrol instead of sacct
1 parent 9966ed9 commit 004ce7a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/runtests.jl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,16 @@ end
1515
println("jobid = $jobid")
1616

1717
# get job state from jobid
18-
getjobstate = jobid -> read(`sacct -j $jobid --format=state --noheader`, String)
18+
getjobstate = jobid -> begin
19+
info = read(`scontrol show $jobid`, String)
20+
state = match(r"JobState=(\S*)", info)
21+
return state
22+
end
1923

2024
# wait for job to complete
2125
status = timedwait(60.0, pollint=1.0) do
2226
state = getjobstate(jobid)
23-
state == "" && return false
24-
state = first(split(state)) # don't care about jobsteps
27+
state == nothing && return false
2528
println("jobstate = $state")
2629
return state == "COMPLETED" || state == "FAILED"
2730
end

0 commit comments

Comments
 (0)