diff -Nru prometheus-2.24.1+ds/debian/changelog prometheus-2.24.1+ds/debian/changelog --- prometheus-2.24.1+ds/debian/changelog 2021-01-20 11:35:15.000000000 -0300 +++ prometheus-2.24.1+ds/debian/changelog 2021-08-16 15:52:50.000000000 -0300 @@ -1,3 +1,10 @@ +prometheus (2.24.1+ds-1ubuntu1) impish; urgency=medium + + * d/p/15-Fix_TestChunkDiskMapper_WriteChunk_Chunk_IterateChunks.patch: add + upstream patch to fix the test with Go 1.16 (LP: #1930752). + + -- Lucas Kanashiro Mon, 16 Aug 2021 15:52:50 -0300 + prometheus (2.24.1+ds-1) unstable; urgency=medium [ Daniel Swarbrick ] diff -Nru prometheus-2.24.1+ds/debian/control prometheus-2.24.1+ds/debian/control --- prometheus-2.24.1+ds/debian/control 2021-01-20 11:35:15.000000000 -0300 +++ prometheus-2.24.1+ds/debian/control 2021-08-16 15:52:50.000000000 -0300 @@ -1,5 +1,6 @@ Source: prometheus -Maintainer: Debian Go Packaging Team +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Debian Go Packaging Team Uploaders: Martina Ferrari , Daniel Swarbrick , Lucas Kanashiro diff -Nru prometheus-2.24.1+ds/debian/patches/15-Fix_TestChunkDiskMapper_WriteChunk_Chunk_IterateChunks.patch prometheus-2.24.1+ds/debian/patches/15-Fix_TestChunkDiskMapper_WriteChunk_Chunk_IterateChunks.patch --- prometheus-2.24.1+ds/debian/patches/15-Fix_TestChunkDiskMapper_WriteChunk_Chunk_IterateChunks.patch 1969-12-31 21:00:00.000000000 -0300 +++ prometheus-2.24.1+ds/debian/patches/15-Fix_TestChunkDiskMapper_WriteChunk_Chunk_IterateChunks.patch 2021-08-16 15:52:44.000000000 -0300 @@ -0,0 +1,75 @@ +From 8bf7bc68f1d678ea82c392f80486a62e7973720b Mon Sep 17 00:00:00 2001 +From: Bartlomiej Plotka +Date: Thu, 25 Feb 2021 10:08:12 +0100 +Subject: [PATCH] Fixed TestChunkDiskMapper_WriteChunk_Chunk_IterateChunks for + go1.16 (#8538) + +Fixes https://github.com/prometheus/prometheus/issues/8403 + +Signed-off-by: Bartlomiej Plotka + +Origin: upstream, https://github.com/prometheus/prometheus/commit/8bf7bc68f1d678e +Reviewed-By: Lucas Kanashiro +Last-Updated: 2021-08-16 +--- + tsdb/chunks/head_chunks.go | 4 +++- + tsdb/chunks/head_chunks_test.go | 11 ++--------- + 2 files changed, 5 insertions(+), 10 deletions(-) + +diff --git a/tsdb/chunks/head_chunks.go b/tsdb/chunks/head_chunks.go +index 051b9b1a89..d5386f7ea1 100644 +--- a/tsdb/chunks/head_chunks.go ++++ b/tsdb/chunks/head_chunks.go +@@ -605,12 +605,14 @@ func (cdm *ChunkDiskMapper) IterateAllChunks(f func(seriesRef, chunkRef uint64, + } + } + if allZeros { ++ // End of segment chunk file content. + break + } + return &CorruptionErr{ + Dir: cdm.dir.Name(), + FileIndex: segID, +- Err: errors.Errorf("head chunk file doesn't include enough bytes to read the chunk header - required:%v, available:%v, file:%d", idx+MaxHeadChunkMetaSize, fileEnd, segID), ++ Err: errors.Errorf("head chunk file has some unread data, but doesn't include enough bytes to read the chunk header"+ ++ " - required:%v, available:%v, file:%d", idx+MaxHeadChunkMetaSize, fileEnd, segID), + } + } + chkCRC32.Reset() +diff --git a/tsdb/chunks/head_chunks_test.go b/tsdb/chunks/head_chunks_test.go +index 43aa0484b4..3519439003 100644 +--- a/tsdb/chunks/head_chunks_test.go ++++ b/tsdb/chunks/head_chunks_test.go +@@ -118,11 +118,6 @@ func TestChunkDiskMapper_WriteChunk_Chunk_IterateChunks(t *testing.T) { + fileEnd := HeadChunkFileHeaderSize + len(expectedBytes) + require.Equal(t, expectedBytes, actualBytes[HeadChunkFileHeaderSize:fileEnd]) + +- // Test for the next chunk header to be all 0s. That marks the end of the file. +- for _, b := range actualBytes[fileEnd : fileEnd+MaxHeadChunkMetaSize] { +- require.Equal(t, byte(0), b) +- } +- + // Testing reading of chunks. + for _, exp := range expectedData { + actChunk, err := hrw.Chunk(exp.chunkRef) +@@ -137,7 +132,7 @@ func TestChunkDiskMapper_WriteChunk_Chunk_IterateChunks(t *testing.T) { + require.NoError(t, err) + + idx := 0 +- err = hrw.IterateAllChunks(func(seriesRef, chunkRef uint64, mint, maxt int64, numSamples uint16) error { ++ require.NoError(t, hrw.IterateAllChunks(func(seriesRef, chunkRef uint64, mint, maxt int64, numSamples uint16) error { + t.Helper() + + expData := expectedData[idx] +@@ -153,10 +148,8 @@ func TestChunkDiskMapper_WriteChunk_Chunk_IterateChunks(t *testing.T) { + + idx++ + return nil +- }) +- require.NoError(t, err) ++ })) + require.Equal(t, len(expectedData), idx) +- + } + + // TestChunkDiskMapper_Truncate tests diff -Nru prometheus-2.24.1+ds/debian/patches/series prometheus-2.24.1+ds/debian/patches/series --- prometheus-2.24.1+ds/debian/patches/series 2021-01-20 11:35:15.000000000 -0300 +++ prometheus-2.24.1+ds/debian/patches/series 2021-08-16 15:46:21.000000000 -0300 @@ -10,3 +10,4 @@ 01-Do_not_embed_blobs.patch 13-Disable_jaeger.patch 14-Disable_wal_test_goleak.patch +15-Fix_TestChunkDiskMapper_WriteChunk_Chunk_IterateChunks.patch