Skip to content

Commit

Permalink
store: add issue 6545 repro
Browse files Browse the repository at this point in the history
Add repro for issue 6545.

Signed-off-by: Giedrius Statkevičius <[email protected]>
  • Loading branch information
GiedriusS committed Aug 1, 2023
1 parent a35a5b2 commit 7880cf2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
Binary file added pkg/store/issue6545_repro
Binary file not shown.
25 changes: 25 additions & 0 deletions pkg/store/postings_codec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ import (
"bytes"
"context"
crand "crypto/rand"
"io"
"math"
"math/rand"
"os"
"sort"
"strconv"
"testing"
Expand Down Expand Up @@ -338,3 +340,26 @@ func FuzzSnappyStreamEncoding(f *testing.F) {
testutil.Ok(t, err)
})
}

func TestDiffVarintDecodingIssue6545(t *testing.T) {
f, err := os.Open("issue6545_repro")
testutil.Ok(t, err)
t.Cleanup(func() { f.Close() })

in, err := io.ReadAll(f)
testutil.Ok(t, err)

postings, err := newStreamedDiffVarintPostings(in, false)
testutil.Ok(t, err)

t.Cleanup(postings.close)

var p storage.SeriesRef
for postings.Next() {
curp := postings.At()
testutil.Assert(t, curp > p)
p = curp
}

testutil.Ok(t, postings.Err())
}

0 comments on commit 7880cf2

Please sign in to comment.