Skip to content

Commit 95da0d8

Browse files
Add system info to start of testsuite. Profile: don't spawn profile listener on windows (#44639)
1 parent d3698a8 commit 95da0d8

File tree

3 files changed

+23
-5
lines changed

3 files changed

+23
-5
lines changed

stdlib/Profile/src/Profile.jl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,12 @@ function __init__()
140140
delay = 0.001
141141
end
142142
init(n, delay, limitwarn = false)
143-
PROFILE_PRINT_COND[] = Base.AsyncCondition()
144-
ccall(:jl_set_peek_cond, Cvoid, (Ptr{Cvoid},), PROFILE_PRINT_COND[].handle)
145-
errormonitor(Threads.@spawn(profile_printing_listener()))
143+
@static if !Sys.iswindows()
144+
# triggering a profile via signals is not implemented on windows
145+
PROFILE_PRINT_COND[] = Base.AsyncCondition()
146+
ccall(:jl_set_peek_cond, Cvoid, (Ptr{Cvoid},), PROFILE_PRINT_COND[].handle)
147+
errormonitor(Threads.@spawn(profile_printing_listener()))
148+
end
146149
end
147150

148151
"""

stdlib/Profile/test/runtests.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,11 @@ let cmd = Base.julia_cmd()
170170
script = """
171171
using Profile
172172
f(::Val) = GC.safepoint()
173-
@profile for i = 1:10^3; f(Val(i)); end
173+
@profile for i = 1:10^3
174+
println(i)
175+
f(Val(i))
176+
end
177+
println("done")
174178
print(Profile.len_data())
175179
"""
176180
p = open(`$cmd -e $script`)
@@ -184,7 +188,9 @@ let cmd = Base.julia_cmd()
184188
s = read(p, String)
185189
close(t)
186190
@test success(p)
187-
@test parse(Int, s) > 100
191+
@test !isempty(s)
192+
@test occursin("done", s)
193+
@test parse(Int, split(s, '\n')[end]) > 100
188194
end
189195

190196
if Sys.isbsd() || Sys.islinux()

test/runtests.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,15 @@ cd(@__DIR__) do
124124
Distributed.remotecall_eval(Main, workers(), revise_init_expr)
125125
end
126126

127+
println("""
128+
Running parallel tests with:
129+
nworkers() = $(nworkers())
130+
nthreads() = $(Threads.nthreads())
131+
Sys.CPU_THREADS = $(Sys.CPU_THREADS)
132+
Sys.total_memory() = $(Base.format_bytes(Sys.total_memory()))
133+
Sys.free_memory() = $(Base.format_bytes(Sys.free_memory()))
134+
""")
135+
127136
#pretty print the information about gc and mem usage
128137
testgroupheader = "Test"
129138
workerheader = "(Worker)"

0 commit comments

Comments
 (0)