Skip to content

Commit

Permalink
Tests fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
attdona committed Dec 13, 2024
1 parent 96d8dbc commit e1dc2a6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
5 changes: 3 additions & 2 deletions codecov.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
codecov:
require_ci_to_pass: yes

ignore:
- src/precompile.jl
coverage:
status:
project:
default: false # disable the default status that measures entire project
source:
paths:
- "src/"
target: 100%
target: 95%
threshold: 0.1
patch:
default:
Expand Down
4 changes: 3 additions & 1 deletion src/Visor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,9 @@ function schedule_start(process::Process, supervisor)
if !isnan(process.debounce_time)
sleep(process.debounce_time)
end
if supervisor.status === idle
# a supervisor may be running, idle or done
# if supervisor is idle or down it means that a shutdown request was issued.
if supervisor.status !== running
@debug "supervisor [$supervisor] terminated, skipping [$process] restart "
else
process.task = start(process)
Expand Down
8 changes: 4 additions & 4 deletions src/precompile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ function task_all(pd)
return nothing
end

function case1()
function run()
try
spec = [process("p1", task_all), process("p2", task_one), process("p3", task_all)]
sv = supervisor("sv", spec)

Visor.format4print(sv.processes)
Visor.format4print(collect(values(sv.processes)))
return nothing
catch e
@error "[precompile] error: $e"
finally
shutdown()
end

return nothing
end

case1()
run()
2 changes: 1 addition & 1 deletion test/test_supervisor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function terminateif_empty()
# then the supervisor terminates when its
# supervised processes are done.

tim = Timer(request_shutdown, 0.1)
tim = Timer(request_shutdown, 0.5)
@async add_process()

supervise(supervisor("dynamic", process(nat)))
Expand Down

0 comments on commit e1dc2a6

Please sign in to comment.