Skip to content

Commit 4168789

Browse files
committed
compression: deflake TestAdaptiveCompressorCompressible
Fix the prng seed to deflake the test. At a handful of rare, random sizes we'd choose the fast algorithm. Close #5037.
1 parent a370be5 commit 4168789

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

internal/compression/adaptive_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@ func TestAdaptiveCompressorCompressible(t *testing.T) {
4444
SampleHalfLife: 128 * 1024,
4545
SamplingSeed: 1,
4646
})
47+
rng := rand.New(rand.NewPCG(0, 0))
4748
defer ac.Close()
4849
for i := 0; i < 100; i++ {
49-
data := make([]byte, 512+rand.IntN(64*1024))
50+
data := make([]byte, 512+rng.IntN(64*1024))
5051
for j := range data {
5152
data[j] = byte(j / 100)
5253
}

0 commit comments

Comments
 (0)