diff --git a/stdlib/Profile/src/Profile.jl b/stdlib/Profile/src/Profile.jl index b11dfb488c373..d3d5300c87527 100644 --- a/stdlib/Profile/src/Profile.jl +++ b/stdlib/Profile/src/Profile.jl @@ -140,9 +140,12 @@ function __init__() delay = 0.001 end init(n, delay, limitwarn = false) - PROFILE_PRINT_COND[] = Base.AsyncCondition() - ccall(:jl_set_peek_cond, Cvoid, (Ptr{Cvoid},), PROFILE_PRINT_COND[].handle) - errormonitor(Threads.@spawn(profile_printing_listener())) + @static if !Sys.iswindows() + # triggering a profile via signals is not implemented on windows + PROFILE_PRINT_COND[] = Base.AsyncCondition() + ccall(:jl_set_peek_cond, Cvoid, (Ptr{Cvoid},), PROFILE_PRINT_COND[].handle) + errormonitor(Threads.@spawn(profile_printing_listener())) + end end """ diff --git a/stdlib/Profile/test/runtests.jl b/stdlib/Profile/test/runtests.jl index 2b3f8beb2beba..6ad05a6b707cb 100644 --- a/stdlib/Profile/test/runtests.jl +++ b/stdlib/Profile/test/runtests.jl @@ -170,7 +170,11 @@ let cmd = Base.julia_cmd() script = """ using Profile f(::Val) = GC.safepoint() - @profile for i = 1:10^3; f(Val(i)); end + @profile for i = 1:10^3 + println(i) + f(Val(i)) + end + println("done") print(Profile.len_data()) """ p = open(`$cmd -e $script`) @@ -184,7 +188,9 @@ let cmd = Base.julia_cmd() s = read(p, String) close(t) @test success(p) - @test parse(Int, s) > 100 + @test !isempty(s) + @test occursin("done", s) + @test parse(Int, split(s, '\n')[end]) > 100 end if Sys.isbsd() || Sys.islinux() diff --git a/test/runtests.jl b/test/runtests.jl index aa9e101fa2182..4c9ac1cfd869c 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -124,6 +124,15 @@ cd(@__DIR__) do Distributed.remotecall_eval(Main, workers(), revise_init_expr) end + println(""" + Running parallel tests with: + nworkers() = $(nworkers()) + nthreads() = $(Threads.nthreads()) + Sys.CPU_THREADS = $(Sys.CPU_THREADS) + Sys.total_memory() = $(Base.format_bytes(Sys.total_memory())) + Sys.free_memory() = $(Base.format_bytes(Sys.free_memory())) + """) + #pretty print the information about gc and mem usage testgroupheader = "Test" workerheader = "(Worker)"