Skip to content
This repository has been archived by the owner on Aug 13, 2019. It is now read-only.

Commit

Permalink
use openTestDB for the test
Browse files Browse the repository at this point in the history
  • Loading branch information
krasi-georgiev committed Feb 24, 2018
1 parent 3ab5105 commit 353cd6e
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -812,16 +812,13 @@ func TestDB_Retention(t *testing.T) {
// TestDBMissingMeta assures that the db can be opened even when a folder is missing the meta file.
// Also ensures that the folder with the missing meta is deleted when reloading the db.
func TestDBMissingMeta(t *testing.T) {
tmpdir, _ := ioutil.TempDir("", "test")
defer os.RemoveAll(tmpdir)

db, err := Open(tmpdir, nil, nil, nil)
testutil.Ok(t, err)
db, close := openTestDB(t, nil)
defer close()

lbls := labels.Labels{labels.Label{Name: "labelname", Value: "labelvalue"}}

app := db.Appender()
_, err = app.Add(lbls, 0, 1)
_, err := app.Add(lbls, 0, 1)
testutil.Ok(t, err)
testutil.Ok(t, app.Commit())

Expand Down

0 comments on commit 353cd6e

Please sign in to comment.