Your message dated Thu, 24 Sep 2026 13:10:31 +0000
with message-id <[email protected]>
and subject line Re: golang-github-peterbourgon-diskv: compression tests FTBFS
with Go 1.27 (patch)
has caused the Debian Bug report #1148754,
regarding golang-github-peterbourgon-diskv: compression tests FTBFS with Go
1.27 (patch)
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
1148754: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1148754
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: src:golang-github-peterbourgon-diskv
Version: 3.0.0-2
Severity: normal
Tags: patch upstream
User: [email protected]
Usertags: origin-ubuntu ubuntu-patch stonking
X-Debbugs-Cc: [email protected]
Dear Maintainer,
In Ubuntu we hit an FTBFS of golang-github-peterbourgon-diskv when the
package is built with Go 1.27:
The compression tests fill a 4 KiB buffer with random bytes in {a-z}
(seeded from the clock) and assert that every flate level shrinks it.
Random data over 26 symbols has no LZ77 back-references, and Go 1.27's
fast flate encoders (levels 1-8) now emit stored (uncompressed) blocks
in that case, so the compressed output can be >= the input and the test
fails non-deterministically.
The attached patch (debian/patches/go1.27-compressible-data.patch)
replaces the payload with deterministic runs of repeated bytes, which
compress reliably at every flate level while still exercising the
compress/decompress round-trip. With Go 1.27 the gzip/deflate
compression tests pass consistently (verified over repeated runs).
The fix has also been forwarded upstream:
https://github.com/peterbourgon/diskv/pull/80
Ubuntu bug for reference:
https://bugs.launchpad.net/bugs/2164597
Thanks for considering.
--
Anshul Singh
Description: Use deterministic compressible test data for Go 1.27
The compression tests filled a 4 KiB buffer with random bytes in {a-z} and
asserted that every flate level shrank it. Random data over 26 symbols has no
LZ77 back-references, and Go 1.27's fast flate encoders (levels 1-8) now emit
stored (uncompressed) blocks in that case, so the output could equal or exceed
the input and the test failed non-deterministically (it also depended on a
clock-seeded PRNG). Replace the payload with deterministic runs of repeated
bytes, which compress reliably at every level while still exercising the
compress/decompress round-trip.
Author: Anshul Singh <[email protected]>
Origin: https://github.com/peterbourgon/diskv/pull/80
Bug-Ubuntu: https://bugs.launchpad.net/bugs/2164597
Forwarded: https://github.com/peterbourgon/diskv/pull/80
Last-Update: 2026-09-23
Index: golang-github-peterbourgon-diskv-3.0.0/compression_test.go
===================================================================
--- golang-github-peterbourgon-diskv-3.0.0.orig/compression_test.go 2026-07-28 21:37:42.000000000 +0900
+++ golang-github-peterbourgon-diskv-3.0.0/compression_test.go 2026-07-28 22:26:54.703198803 +0900
@@ -3,16 +3,10 @@
import (
"compress/flate"
"fmt"
- "math/rand"
"os"
"testing"
- "time"
)
-func init() {
- rand.Seed(time.Now().UnixNano())
-}
-
func testCompressionWith(t *testing.T, c Compression, name string) {
d := New(Options{
BasePath: "compression-test",
@@ -24,7 +18,12 @@
sz := 4096
val := make([]byte, sz)
for i := 0; i < sz; i++ {
- val[i] = byte('a' + rand.Intn(26)) // {a-z}; should compress some
+ // Deterministic, LZ77-compressible payload (runs of repeated bytes).
+ // Go 1.27's fast flate encoders (levels 1-8) emit stored, uncompressed
+ // blocks when a block has no back-references, so the previous random
+ // {a-z} data would (non-deterministically) fail to shrink at those
+ // levels. Repeated runs compress reliably at every level.
+ val[i] = byte('a' + (i/16)%26)
}
key := "a"
--- End Message ---
--- Begin Message ---
Source: golang-github-peterbourgon-diskv
Source-Version: 3.0.0-3
Done: Mathias Gibbens <[email protected]>
Hi Anshul,
I actually fixed the same issue yesterday as part of bug #1146207. :)
I took the approach of reducing the compression entropy used in the
tests. Upstream seems pretty inactive, but if/when a new release is
made with either fix the Debian packaging will pick it up.
Mathias
signature.asc
Description: This is a digitally signed message part
--- End Message ---