Skip to content

Commit cc016af

Browse files
authored
Don't leave the flamegraph headless in tests (#156)
The fix in #155 was incomplete, this should do it.
1 parent 65b4924 commit cc016af

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/snoopi_deep.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ end
5353
end
5454

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

0 commit comments

Comments
 (0)