mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-11 22:07:27 -08:00
tsdb tests: make work with labels SymbolTable
Need to initialize decoders with SymbolTable. Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
This commit is contained in:
parent
93b72ec5dd
commit
925134e6de
|
@ -184,7 +184,7 @@ func TestCommit(t *testing.T) {
|
|||
// Read records from WAL and check for expected count of series, samples, and exemplars.
|
||||
var (
|
||||
r = wlog.NewReader(sr)
|
||||
dec record.Decoder
|
||||
dec = record.NewDecoder(labels.NewSymbolTable())
|
||||
|
||||
walSeriesCount, walSamplesCount, walExemplarsCount, walHistogramCount, walFloatHistogramCount int
|
||||
)
|
||||
|
@ -293,7 +293,7 @@ func TestRollback(t *testing.T) {
|
|||
// Read records from WAL and check for expected count of series and samples.
|
||||
var (
|
||||
r = wlog.NewReader(sr)
|
||||
dec record.Decoder
|
||||
dec = record.NewDecoder(labels.NewSymbolTable())
|
||||
|
||||
walSeriesCount, walSamplesCount, walHistogramCount, walFloatHistogramCount, walExemplarsCount int
|
||||
)
|
||||
|
@ -737,7 +737,7 @@ func TestStorage_DuplicateExemplarsIgnored(t *testing.T) {
|
|||
defer sr.Close()
|
||||
r := wlog.NewReader(sr)
|
||||
|
||||
var dec record.Decoder
|
||||
dec := record.NewDecoder(labels.NewSymbolTable())
|
||||
for r.Next() {
|
||||
rec := r.Record()
|
||||
if dec.Type(rec) == record.Exemplars {
|
||||
|
|
|
@ -4031,7 +4031,7 @@ func TestOOOWALWrite(t *testing.T) {
|
|||
|
||||
var (
|
||||
records []interface{}
|
||||
dec record.Decoder
|
||||
dec record.Decoder = record.NewDecoder(labels.NewSymbolTable())
|
||||
)
|
||||
for r.Next() {
|
||||
rec := r.Record()
|
||||
|
@ -5390,7 +5390,7 @@ func TestWBLAndMmapReplay(t *testing.T) {
|
|||
require.NoError(t, err)
|
||||
sr, err := wlog.NewSegmentsReader(originalWblDir)
|
||||
require.NoError(t, err)
|
||||
var dec record.Decoder
|
||||
dec := record.NewDecoder(labels.NewSymbolTable())
|
||||
r, markers, addedRecs := wlog.NewReader(sr), 0, 0
|
||||
for r.Next() {
|
||||
rec := r.Record()
|
||||
|
|
|
@ -172,7 +172,7 @@ func readTestWAL(t testing.TB, dir string) (recs []interface{}) {
|
|||
require.NoError(t, sr.Close())
|
||||
}()
|
||||
|
||||
var dec record.Decoder
|
||||
dec := record.NewDecoder(labels.NewSymbolTable())
|
||||
r := wlog.NewReader(sr)
|
||||
|
||||
for r.Next() {
|
||||
|
|
|
@ -29,7 +29,7 @@ import (
|
|||
|
||||
func TestRecord_EncodeDecode(t *testing.T) {
|
||||
var enc Encoder
|
||||
var dec Decoder
|
||||
dec := NewDecoder(labels.NewSymbolTable())
|
||||
|
||||
series := []RefSeries{
|
||||
{
|
||||
|
@ -187,7 +187,7 @@ func TestRecord_EncodeDecode(t *testing.T) {
|
|||
// Bugfix check for pull/521 and pull/523.
|
||||
func TestRecord_Corrupted(t *testing.T) {
|
||||
var enc Encoder
|
||||
var dec Decoder
|
||||
dec := NewDecoder(labels.NewSymbolTable())
|
||||
|
||||
t.Run("Test corrupted series record", func(t *testing.T) {
|
||||
series := []RefSeries{
|
||||
|
|
|
@ -510,7 +510,7 @@ func TestMigrateWAL_Fuzz(t *testing.T) {
|
|||
|
||||
r := wlog.NewReader(sr)
|
||||
var res []interface{}
|
||||
var dec record.Decoder
|
||||
dec := record.NewDecoder(labels.NewSymbolTable())
|
||||
|
||||
for r.Next() {
|
||||
rec := r.Record()
|
||||
|
|
|
@ -237,7 +237,7 @@ func TestCheckpoint(t *testing.T) {
|
|||
require.NoError(t, err)
|
||||
defer sr.Close()
|
||||
|
||||
var dec record.Decoder
|
||||
dec := record.NewDecoder(labels.NewSymbolTable())
|
||||
var series []record.RefSeries
|
||||
var metadata []record.RefMetadata
|
||||
r := NewReader(sr)
|
||||
|
|
Loading…
Reference in a new issue