Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtests: Print currently running tests when asked #34212

Merged
merged 1 commit into from
Dec 29, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -155,16 +155,24 @@ cd(@__DIR__) do
try
# Monitor stdin and kill this task on ^C
# but don't do this on Windows, because it may deadlock in the kernel
running_tests = Dict{String, DateTime}()
if !Sys.iswindows() && isa(stdin, Base.TTY)
t = current_task()
stdin_monitor = @async begin
term = REPL.Terminals.TTYTerminal("xterm", stdin, stdout, stderr)
try
REPL.Terminals.raw!(term, true)
while true
if read(term, Char) == '\x3'
c = read(term, Char)
if c == '\x3'
Base.throwto(t, InterruptException())
break
elseif c == '?'
println("Currently running: ")
tests = sort(collect(running_tests), by=x->x[2])
foreach(tests) do (test, date)
println(test, " (running for ", round(now()-date, Minute), ")")
end
end
end
catch e
Expand All @@ -180,6 +188,7 @@ cd(@__DIR__) do
push!(all_tasks, current_task())
while length(tests) > 0
test = popfirst!(tests)
running_tests[test] = now()
local resp
wrkr = p
try
Expand All @@ -188,6 +197,7 @@ cd(@__DIR__) do
isa(e, InterruptException) && return
resp = Any[e]
end
delete!(running_tests, test)
push!(results, (test, resp))
if resp[1] isa Exception
print_testworker_errored(test, wrkr)
Expand Down