mirror of
https://github.com/prometheus/prometheus
synced 2024-12-24 07:23:02 +00:00
Fix failing tests
Signed-off-by: Annanay <annanayagarwal@gmail.com>
This commit is contained in:
parent
9bba8a6eae
commit
263d2aa5f5
@ -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)
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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…
Reference in New Issue
Block a user