diff --git a/tsdb/record/record_test.go b/tsdb/record/record_test.go index 518942314..9111350a7 100644 --- a/tsdb/record/record_test.go +++ b/tsdb/record/record_test.go @@ -15,10 +15,10 @@ package record import ( + "errors" "math/rand" "testing" - "github.com/pkg/errors" "github.com/stretchr/testify/require" "github.com/prometheus/prometheus/model/histogram" @@ -209,7 +209,7 @@ func TestRecord_Corrupted(t *testing.T) { corrupted := enc.Samples(samples, nil)[:8] _, err := dec.Samples(corrupted, nil) - require.Equal(t, errors.Cause(err), encoding.ErrInvalidSize) + require.True(t, errors.Is(err, encoding.ErrInvalidSize)) }) t.Run("Test corrupted tombstone record", func(t *testing.T) { @@ -232,7 +232,7 @@ func TestRecord_Corrupted(t *testing.T) { corrupted := enc.Exemplars(exemplars, nil)[:8] _, err := dec.Exemplars(corrupted, nil) - require.Equal(t, errors.Cause(err), encoding.ErrInvalidSize) + require.True(t, errors.Is(err, encoding.ErrInvalidSize)) }) t.Run("Test corrupted metadata record", func(t *testing.T) { @@ -242,7 +242,7 @@ func TestRecord_Corrupted(t *testing.T) { corrupted := enc.Metadata(meta, nil)[:8] _, err := dec.Metadata(corrupted, nil) - require.Equal(t, errors.Cause(err), encoding.ErrInvalidSize) + require.True(t, errors.Is(err, encoding.ErrInvalidSize)) }) t.Run("Test corrupted histogram record", func(t *testing.T) { @@ -267,7 +267,7 @@ func TestRecord_Corrupted(t *testing.T) { corrupted := enc.HistogramSamples(histograms, nil)[:8] _, err := dec.HistogramSamples(corrupted, nil) - require.Equal(t, errors.Cause(err), encoding.ErrInvalidSize) + require.True(t, errors.Is(err, encoding.ErrInvalidSize)) }) }