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

Improve test robustness #75

Merged
merged 7 commits into from
Feb 22, 2025
Merged
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- master
tags: '*'

concurrency:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

Expand Down Expand Up @@ -43,6 +43,8 @@ jobs:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v2
with:
cache-registries: ${{ ! (matrix.version == '1.6' && matrix.os == 'windows-latest') }}
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-runtest@latest
- uses: julia-actions/julia-processcoverage@latest
Expand Down
33 changes: 21 additions & 12 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,12 @@ end
A = randn(100, 100, 200)
Profile.clear()
mapslices(sum, A; dims=2) # compile it so we don't end up profiling inference
@profile mapslices(sum, A; dims=2)
g = flamegraph()
g = nothing
for _ in 1:10
@profile mapslices(sum, A; dims=2)
g = flamegraph()
FlameGraphs.depth(g) > 10 && break
end
@test FlameGraphs.depth(g) > 10
img = flamepixels(StackFrameCategory(), flamegraph(C=true))
@test any(img .== colorant"orange")
Expand All @@ -461,18 +465,21 @@ end
end
Ts = subtypes(Any)[1:20] # we don't need all of them
mappushes!(spell_spec, [], Ts)
@profile for i = 1:1000
mappushes!(spell_spec, [], Ts)
end
_, sfdict = Profile.retrieve()
rtds = []
for sfs in values(sfdict)
for sf in sfs
if (FlameGraphs.status(sf) & FlameGraphs.runtime_dispatch) != 0
push!(rtds, sfs)
break
for _ in 1:10 # try to get a runtime dispatch on unfortunately flaky profiling
@profile for i = 1:10000
mappushes!(spell_spec, [], Ts)
end
_, sfdict = Profile.retrieve()
for sfs in values(sfdict)
for sf in sfs
if (FlameGraphs.status(sf) & FlameGraphs.runtime_dispatch) != 0
push!(rtds, sfs)
break
end
end
end
isempty(rtds) || break
end
@test !isempty(rtds)
end
Expand Down Expand Up @@ -503,7 +510,9 @@ end

A = randn(100, 100, 200)
Profile.clear()
@profile mapslices(sum, A; dims=2)
while Profile.len_data() == 0
@profile mapslices(sum, A; dims=2)
end
fn = tempname()*".jlprof"
f = File{format"JLPROF"}(fn)
FlameGraphs.save(f)
Expand Down
Loading