Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "SweepRunner"
uuid = "be946ad2-3cb3-4b6e-8f7e-4a5ecc3c255b"
version = "0.6.7"
version = "0.6.8"
authors = ["sota shimozono <shimozono-sota631@g.ecc.u-tokyo.ac.jp>"]

[deps]
Expand Down
12 changes: 10 additions & 2 deletions test/run/test_run_deadline.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,16 @@ end
keys = ParamIO.expand(v.spec)
@test length(keys) > 1
started = Ref(0)
deadline = time() + 0.3
work = k -> (started[] += 1; sleep(0.6); Dict{String,Any}("x" => 1))
# The first key runs until the deadline has passed, so the test does not depend on how long
# `run!` takes to hand it out — only that it is under the margin. A 0.3 s margin was not:
# a run-start observation takes most of a second, and on a hosted runner no key was handed
# out at all (started == 0).
deadline = time() + 5.0
work = k -> begin
started[] += 1
sleep(max(0.0, deadline - time()) + 0.1)
Dict{String,Any}("x" => 1)
end
r = run!(work, v, keys; opts=RunOpts(workers=:sequential, deadline=deadline))
@test started[] >= 1 # the first key ran
@test started[] < length(keys) # later keys were not handed out
Expand Down
6 changes: 5 additions & 1 deletion test/run/test_run_loop_busy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ end
@test n[] == 1 # it ran the key
@test DataVault.is_done(v, ks[1]) # and the campaign is complete
@test r.done == 1
@test elapsed >= 3.0 # it waited stale_after out rather than giving up
# It waited stale_after out rather than giving up (the bug gave up after two empty rounds,
# ~1 s). Less one second: DataVault writes `heartbeat=` truncated to the second, so the lock
# reads up to 1 s older than it is and is reclaimed up to 1 s before stale_after. Asserting
# the full 3.0 failed on hosted runners at 2.85 s and 2.90 s.
@test elapsed >= 3.0 - 1.0
end
end

Expand Down
Loading