Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed TestChunkDiskMapper_WriteChunk_Chunk_IterateChunks for go1.16 #8538

Merged
merged 1 commit into from Feb 25, 2021

Conversation

bwplotka
Copy link
Member

Fixes #8403

Signed-off-by: Bartlomiej Plotka bwplotka@gmail.com

Fixes #8403

Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
@@ -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] {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I double-checked and we don't need this assertion. If anything is wrong here (some of those bytes are non-zero), IterateAllChunks will fail with CorruptionErr anyway:

func (cdm *ChunkDiskMapper) IterateAllChunks(f func(seriesRef, chunkRef uint64, mint, maxt int64, numSamples uint16) error) (err error) {

@bwplotka
Copy link
Member Author

cc @codesome

@codesome codesome merged commit 8bf7bc6 into main Feb 25, 2021
@codesome codesome deleted the fixtest branch February 25, 2021 09:08
jwendell pushed a commit to jwendell/prometheus that referenced this pull request Oct 17, 2023
openshift-ci bot pushed a commit to maistra/prometheus that referenced this pull request Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error with go1.16 in TestChunkDiskMapper_WriteChunk_Chunk_IterateChunks
2 participants