Skip to content

Commit 044ee75

Browse files
authored
fix: flaky pprof test (#990)
1 parent 861a415 commit 044ee75

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/convert/pprof/pprof_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package pprof
22

33
import (
4+
"sort"
45
"time"
56

67
. "github.com/onsi/ginkgo/v2"
@@ -109,8 +110,10 @@ var _ = Describe("custom pprof parsing", func() {
109110

110111
err = w.WriteProfile(start, end, spyName, p)
111112
Expect(err).ToNot(HaveOccurred())
112-
113113
Expect(ingester.actual).To(HaveLen(2))
114+
sort.Slice(ingester.actual, func(i, j int) bool {
115+
return ingester.actual[i].Key.Normalized() < ingester.actual[j].Key.Normalized()
116+
})
114117

115118
input := ingester.actual[0]
116119
Expect(input.SpyName).To(Equal(spyName))

0 commit comments

Comments
 (0)