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
Copy file name to clipboardExpand all lines: src/ParallelTestRunner.jl
+13-11Lines changed: 13 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -787,8 +787,8 @@ function runtests(mod::Module, args::ParsedArgs;
787
787
sort!(tests, by = x ->-get(historical_durations, x, Inf))
788
788
789
789
# determine parallelism
790
-
jobs=something(args.jobs, default_njobs())
791
-
jobs =clamp(jobs, 1, length(tests))
790
+
_jobs=something(args.jobs, default_njobs())
791
+
jobs::Int=clamp(_jobs, 1, length(tests))
792
792
println(stdout, "Running $jobs tests in parallel. If this is too many, specify the `--jobs=N` argument to the tests, or set the `JULIA_CPU_THREADS` environment variable.")
793
793
nworkers =min(jobs, length(tests))
794
794
workers =fill(nothing, nworkers)
@@ -798,10 +798,10 @@ function runtests(mod::Module, args::ParsedArgs;
798
798
running_tests =Dict{String, Float64}() # test => start_time
799
799
test_lock =ReentrantLock() # to protect crucial access to tests and running_tests
800
800
801
-
done =false
801
+
done =Ref(false)
802
802
functionstop_work()
803
-
if!done
804
-
done =true
803
+
if!done[]
804
+
done[]=true
805
805
for task in worker_tasks
806
806
task ==current_task() &&continue
807
807
Base.istaskdone(task) &&continue
@@ -950,7 +950,7 @@ function runtests(mod::Module, args::ParsedArgs;
0 commit comments