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
+17-15Lines changed: 17 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -493,7 +493,7 @@ dictionary mapping test names to expression that include each test file.
493
493
"""
494
494
functionfind_tests(dir::String)
495
495
tests =Dict{String, Expr}()
496
-
for (rootpath, dirs, files) inwalkdir(dir)
496
+
for (rootpath, _dirs, files) inwalkdir(dir)
497
497
# find Julia files
498
498
filter!(files) do file
499
499
endswith(file, ".jl") && file !=="runtests.jl"
@@ -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
@@ -837,7 +837,7 @@ function runtests(mod::Module, args::ParsedArgs;
837
837
838
838
functionclear_status()
839
839
if status_lines_visible[] >0
840
-
foriin1:status_lines_visible[]-1
840
+
for_in1:(status_lines_visible[]-1)
841
841
print(io_ctx.stdout, "\033[2K") # Clear entire line
842
842
print(io_ctx.stdout, "\033[1A") # Move up one line
843
843
end
@@ -950,7 +950,7 @@ function runtests(mod::Module, args::ParsedArgs;
0 commit comments