Skip to content

Errors in CI with threads #281

Description

@MarcMush

During the CI of #157, this error happened once only (didn't happen when re-running the job)
https://github.com/timholy/ProgressMeter.jl/actions/runs/6605620538/job/17940975807?pr=157#step:7:15122

this code errored:

println("Testing ProgressThresh() with Threads.@threads across $threads threads")
thresh = 1.0
prog = ProgressMeter.ProgressThresh(thresh; desc="Minimizing:")
vals = fill(300.0, 1)
threadsUsed = Int[]
Threads.@threads for _ in 1:100000
!in(Threads.threadid(), threadsUsed) && push!(threadsUsed, Threads.threadid())
push!(vals, -rand())
valssum = sum(vals)
if valssum > thresh
ProgressMeter.update!(prog, valssum)
else
ProgressMeter.finish!(prog)
break
end
sleep(0.1*rand())
end
@test sum(vals) <= thresh
@test length(threadsUsed) == threads #Ensure that all threads are used

basically sum([300.0; -rand()...]) == NaN ??

the seed is set in test.jl so it should be repetable

is it because of threads? It doesn't seem to be a problem with ProgressMeter.jl really

Or is it not a big deal since it happened only once in a CI?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions