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

Commit 353cd6e

Browse files
use openTestDB for the test
1 parent 3ab5105 commit 353cd6e

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

db_test.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -812,16 +812,13 @@ func TestDB_Retention(t *testing.T) {
812812
// TestDBMissingMeta assures that the db can be opened even when a folder is missing the meta file.
813813
// Also ensures that the folder with the missing meta is deleted when reloading the db.
814814
func TestDBMissingMeta(t *testing.T) {
815-
tmpdir, _ := ioutil.TempDir("", "test")
816-
defer os.RemoveAll(tmpdir)
817-
818-
db, err := Open(tmpdir, nil, nil, nil)
819-
testutil.Ok(t, err)
815+
db, close := openTestDB(t, nil)
816+
defer close()
820817

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

823820
app := db.Appender()
824-
_, err = app.Add(lbls, 0, 1)
821+
_, err := app.Add(lbls, 0, 1)
825822
testutil.Ok(t, err)
826823
testutil.Ok(t, app.Commit())
827824

0 commit comments

Comments
 (0)