Address comments

Signed-off-by: Annanay <annanayagarwal@gmail.com>
This commit is contained in:
Annanay 2020-07-30 17:25:51 +05:30
parent 0b4d448d29
commit 48b9afd14b

View file

@ -911,8 +911,7 @@ func TestDisableAutoCompactions(t *testing.T) {
// Trigger a compaction to check that it was skipped and // Trigger a compaction to check that it was skipped and
// no new blocks were created when compaction is disabled. // no new blocks were created when compaction is disabled.
db.DisableCompactions() db.DisableCompactions()
ctx := context.Background() app := db.Appender(context.Background())
app := db.Appender(ctx)
for i := int64(0); i < 3; i++ { for i := int64(0); i < 3; i++ {
_, err := app.Add(label, i*blockRange, 0) _, err := app.Add(label, i*blockRange, 0)
testutil.Ok(t, err) testutil.Ok(t, err)
@ -1028,8 +1027,7 @@ func TestDeleteCompactionBlockAfterFailedReload(t *testing.T) {
defaultLabel := labels.FromStrings("foo", "bar") defaultLabel := labels.FromStrings("foo", "bar")
// Add some data to the head that is enough to trigger a compaction. // Add some data to the head that is enough to trigger a compaction.
ctx := context.Background() app := db.Appender(context.Background())
app := db.Appender(ctx)
_, err := app.Add(defaultLabel, 1, 0) _, err := app.Add(defaultLabel, 1, 0)
testutil.Ok(t, err) testutil.Ok(t, err)
_, err = app.Add(defaultLabel, 2, 0) _, err = app.Add(defaultLabel, 2, 0)