Skip to content

Commit

Permalink
Don't leave the flamegraph headless in tests (#156)
Browse files Browse the repository at this point in the history
The fix in #155 was incomplete, this should do it.
  • Loading branch information
timholy authored Nov 25, 2020
1 parent 65b4924 commit cc016af
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/snoopi_deep.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ end
end

t1, t2 = times[1][1], times[2][1]
if t1 != t2 # in rare cases it happens that the bottom two have the same time, but the test requires a gap
# Ensure there's a timing gap, and that cutting off the fastest-to-infer won't leave the tree headless
if t1 != t2 && times[1][2].mi.def.name !== :g
cutoff_bottom_frame = (t1 + t2) / 2
fg2 = SnoopCompile.flamegraph(timing, tmin_secs = cutoff_bottom_frame)
@test length(collect(AbstractTrees.PreOrderDFS(fg2))) == (length(collect(AbstractTrees.PreOrderDFS(fg))) - 1)
Expand Down

0 comments on commit cc016af

Please sign in to comment.