Skip to content

Commit 69176b7

Browse files
committed
spinning wheel: increase Channel buffer so as to not absurdly wait on it
1 parent 3b15a1d commit 69176b7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/ReTest.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,12 +383,18 @@ function retest(args::Union{Module,AbstractString,Regex}...;
383383
printlock = ReentrantLock()
384384
previewchan =
385385
if stdout isa Base.TTY && (nthreads() > 1 || nprocs() > 1)
386-
RemoteChannel(() -> Channel{Union{String,Nothing}}(1))
386+
RemoteChannel(() -> Channel{Union{String,Nothing}}(Inf))
387387
# needs to be "remote" in the case nprocs() == 2, as then nworkers() == 1,
388388
# which means the one remote worker will put descriptions on previewchan
389389
# (if nworkers() > 1, descriptions are not put because we can't predict
390390
# the order in which they complete, and then the previewer will
391391
# not show the descriptions, just the spinning wheel)
392+
393+
# channel size: if nworkers() == 1, then 2 would suffice (one for
394+
# the "compilation step", one for @testset execution step, and then
395+
# the printer would empty the channel; but for two workers and more,
396+
# this second step is not done, so the buffer needs a size of at least
397+
# `nworkers()`
392398
else
393399
# otherwise, the previewing doesn't work well, because the worker task
394400
# keeps the thread busy and doesn't yield enough for previewing to be useful

0 commit comments

Comments
 (0)