Skip to content

Commit 80d4e40

Browse files
authored
fix: flaky Test_toPprof (#36)
1 parent 49987e6 commit 80d4e40

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

fgprof.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,10 @@ nextStack:
205205
}
206206
stacks = append(stacks, ws)
207207
}
208+
// sort stacks by count to create stable output for testing purposes.
209+
sort.Slice(stacks, func(i, j int) bool {
210+
return stacks[i].count < stacks[j].count
211+
})
208212
return stacks
209213
}
210214

0 commit comments

Comments
 (0)