diff --git a/tsdb/head_test.go b/tsdb/head_test.go index c4bb77467..a9350ecb9 100644 --- a/tsdb/head_test.go +++ b/tsdb/head_test.go @@ -679,10 +679,10 @@ func TestHead_ReadWAL(t *testing.T) { s50 := head.series.getByID(50) s100 := head.series.getByID(100) - require.Equal(t, labels.FromStrings("a", "1"), s10.lset) - require.Equal(t, (*memSeries)(nil), s11) // Series without samples should be garbage collected at head.Init(). - require.Equal(t, labels.FromStrings("a", "4"), s50.lset) - require.Equal(t, labels.FromStrings("a", "3"), s100.lset) + testutil.RequireEqual(t, labels.FromStrings("a", "1"), s10.lset) + require.Nil(t, s11) // Series without samples should be garbage collected at head.Init(). + testutil.RequireEqual(t, labels.FromStrings("a", "4"), s50.lset) + testutil.RequireEqual(t, labels.FromStrings("a", "3"), s100.lset) expandChunk := func(c chunkenc.Iterator) (x []sample) { for c.Next() == chunkenc.ValFloat { @@ -709,7 +709,7 @@ func TestHead_ReadWAL(t *testing.T) { require.NoError(t, err) e, err := q.Select(0, 1000, []*labels.Matcher{labels.MustNewMatcher(labels.MatchEqual, "a", "1")}) require.NoError(t, err) - require.Equal(t, exemplar.Exemplar{Ts: 100, Value: 1, Labels: labels.FromStrings("traceID", "asdf")}, e[0].Exemplars[0]) + require.True(t, exemplar.Exemplar{Ts: 100, Value: 1, Labels: labels.FromStrings("traceID", "asdf")}.Equals(e[0].Exemplars[0])) }) } } diff --git a/tsdb/repair_test.go b/tsdb/repair_test.go index c199ecdd4..8a70e05f3 100644 --- a/tsdb/repair_test.go +++ b/tsdb/repair_test.go @@ -25,6 +25,7 @@ import ( "github.com/prometheus/prometheus/tsdb/chunks" "github.com/prometheus/prometheus/tsdb/fileutil" "github.com/prometheus/prometheus/tsdb/index" + "github.com/prometheus/prometheus/util/testutil" ) func TestRepairBadIndexVersion(t *testing.T) { @@ -112,7 +113,7 @@ func TestRepairBadIndexVersion(t *testing.T) { } require.NoError(t, p.Err()) - require.Equal(t, []labels.Labels{ + testutil.RequireEqual(t, []labels.Labels{ labels.FromStrings("a", "1", "b", "1"), labels.FromStrings("a", "2", "b", "1"), }, res)