diff --git a/web/web_test.go b/web/web_test.go index f5711235f..f8bac60e7 100644 --- a/web/web_test.go +++ b/web/web_test.go @@ -116,7 +116,9 @@ func TestReadyAndHealthy(t *testing.T) { db, err := tsdb.Open(dbDir, nil, nil, nil, nil) require.NoError(t, err) - + t.Cleanup(func() { + require.NoError(t, db.Close()) + }) port := fmt.Sprintf(":%d", testutil.RandomUnprivilegedPort(t)) opts := &Options{ @@ -237,6 +239,9 @@ func TestRoutePrefix(t *testing.T) { db, err := tsdb.Open(dbDir, nil, nil, nil, nil) require.NoError(t, err) + t.Cleanup(func() { + require.NoError(t, db.Close()) + }) port := fmt.Sprintf(":%d", testutil.RandomUnprivilegedPort(t)) @@ -404,7 +409,9 @@ func TestShutdownWithStaleConnection(t *testing.T) { db, err := tsdb.Open(dbDir, nil, nil, nil, nil) require.NoError(t, err) - + t.Cleanup(func() { + require.NoError(t, db.Close()) + }) timeout := 10 * time.Second port := fmt.Sprintf(":%d", testutil.RandomUnprivilegedPort(t))