Browse Source

Fix failing tests

Signed-off-by: Annanay <annanayagarwal@gmail.com>
pull/7660/head
Annanay 4 years ago
parent
commit
263d2aa5f5
  1. 2
      tsdb/compact_test.go
  2. 5
      tsdb/querier_bench_test.go
  3. 2
      tsdb/querier_test.go

2
tsdb/compact_test.go

@ -878,7 +878,7 @@ func BenchmarkCompactionFromHead(b *testing.B) {
h, err := NewHead(nil, nil, nil, 1000, chunkDir, nil, DefaultStripeSize, nil)
testutil.Ok(b, err)
for ln := 0; ln < labelNames; ln++ {
app := h.Appender()
app := h.Appender(context.Background())
for lv := 0; lv < labelValues; lv++ {
app.Add(labels.FromStrings(fmt.Sprintf("%d", ln), fmt.Sprintf("%d%s%d", lv, postingsBenchSuffix, ln)), 0, 0)
}

5
tsdb/querier_bench_test.go

@ -14,6 +14,7 @@
package tsdb
import (
"context"
"fmt"
"io/ioutil"
"os"
@ -41,7 +42,7 @@ func BenchmarkPostingsForMatchers(b *testing.B) {
testutil.Ok(b, h.Close())
}()
app := h.Appender()
app := h.Appender(context.Background())
addSeries := func(l labels.Labels) {
app.Add(l, 0, 0)
}
@ -147,7 +148,7 @@ func BenchmarkQuerierSelect(b *testing.B) {
h, err := NewHead(nil, nil, nil, 1000, chunkDir, nil, DefaultStripeSize, nil)
testutil.Ok(b, err)
defer h.Close()
app := h.Appender()
app := h.Appender(context.Background())
numSeries := 1000000
for i := 0; i < numSeries; i++ {
app.Add(labels.FromStrings("foo", "bar", "i", fmt.Sprintf("%d%s", i, postingsBenchSuffix)), int64(i), 0)

2
tsdb/querier_test.go

@ -1875,7 +1875,7 @@ func TestPostingsForMatchers(t *testing.T) {
testutil.Ok(t, h.Close())
}()
app := h.Appender()
app := h.Appender(context.Background())
app.Add(labels.FromStrings("n", "1"), 0, 0)
app.Add(labels.FromStrings("n", "1", "i", "a"), 0, 0)
app.Add(labels.FromStrings("n", "1", "i", "b"), 0, 0)

Loading…
Cancel
Save