You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Broken testitem: the scan's expectation test errors on a soft-scope UndefVarError #371
The testitem "the scan's expectation stops at the first modifier that draws" in test/unit/infection_models/renewal_step.jl:265 errors instead of running.
the scan's expectation stops at the first modifier that draws: Error During Test
at test/unit/infection_models/renewal_step.jl:265
Got exception outside of a @test
LoadError: UndefVarError: `window` not defined in local scope
Suggestion: check for an assignment to a local variable that shadows a global of the same name.
Stacktrace:
[1] top-level scope
@ test/unit/infection_models/renewal_step.jl:293
The reference recurrence binds window and S at the testitem's top level and
then reassigns both inside the loop.
window, S = init.window, N
for R in Rt
foi =renewal_foi(core, window, R) # line 293...
S -= depleted
window =vcat(window[2:end], draw)
end
Julia's soft-scope rule makes an assignment inside a loop create a new local
when the run is not interactive, so line 293 reads window before it is bound.
Wrapping the recurrence in a let block or a small function fixes it.
This matters because the testitem is the one that pins the recorded expectation
against all three of the bare force of infection, the post-depletion incidence
and the committed draw.
That is the case #337 got wrong, so the property is currently unverified.
Found on 289-noise (#348).
The testitem arrived in 9a01bdc and the last Test workflow run on that branch
was at 503cf5a, one commit earlier, so no CI run has ever exercised it. origin/main does not carry the testitem and the file passes there.
This was opened by a bot. Please ping @seabbs for any questions.
Fixed on 289-noise in the InfectionNoise PR (#348) rather than deferred, since the testitem pins the property that PR exists to establish.
The recurrence is now bound in a let block, with a comment saying why it is load-bearing. renewal_step.jl goes from 58 pass / 1 error to 62 pass / 0 errors.
Worth recording the reason it went unnoticed: the last Test workflow run on the branch was at 503cf5a2, one commit before the testitem arrived, so CI had never executed it.
This was opened by a bot. Please ping @seabbs for any questions.
Activity
seabbs-bot commentedon Sep 4, 2026
Fixed on
289-noisein the InfectionNoise PR (#348) rather than deferred, since the testitem pins the property that PR exists to establish.The recurrence is now bound in a
letblock, with a comment saying why it is load-bearing.renewal_step.jlgoes from 58 pass / 1 error to 62 pass / 0 errors.Worth recording the reason it went unnoticed: the last
Testworkflow run on the branch was at503cf5a2, one commit before the testitem arrived, so CI had never executed it.This was opened by a bot. Please ping @seabbs for any questions.