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

Commit 92f160d

Browse files
committed
Remove uncessary db.Open(), add full stops in comments
1 parent a6ee2cc commit 92f160d

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

cmd/tsdb/main_test.go

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,6 @@ func createRoDb(t *testing.T) (*tsdb.DBReadOnly, func()) {
3737
safeDBOptions.RetentionDuration = 0
3838

3939
testutildb.CreateBlock(nil, tmpdir, testutildb.GenSeries(1, 1, 0, 1))
40-
db, err := tsdb.Open(tmpdir, nil, nil, &safeDBOptions)
41-
if err != nil {
42-
os.RemoveAll(tmpdir)
43-
t.Error(err)
44-
}
45-
if err = db.Close(); err != nil {
46-
t.Error(err)
47-
}
4840

4941
dbRO, err := tsdb.OpenDBReadOnly(tmpdir, nil)
5042
if err != nil {
@@ -57,7 +49,7 @@ func createRoDb(t *testing.T) (*tsdb.DBReadOnly, func()) {
5749
}
5850

5951
func TestPrintBlocks(t *testing.T) {
60-
db, closeFn := createTestRODBWithBlock(t)
52+
db, closeFn := createRoDb(t)
6153
defer closeFn()
6254

6355
var b bytes.Buffer
@@ -71,14 +63,14 @@ func TestPrintBlocks(t *testing.T) {
7163
t.Error(err)
7264
}
7365

74-
// Test table header
66+
// Test table header.
7567
actual := b.String()
7668
expected := fmt.Sprintln(printBlocksTableHeader)
7769
if expected != actual {
7870
t.Errorf("expected (%#v) != actual (%#v)", expected, actual)
7971
}
8072

81-
// Set table contents
73+
// Set table contents.
8274
blocks, err := db.Blocks()
8375
if err != nil {
8476
t.Error(err)
@@ -99,7 +91,7 @@ func TestPrintBlocks(t *testing.T) {
9991
t.Error(err)
10092
}
10193

102-
// Test table contents
94+
// Test table contents.
10395
var actualStdout bytes.Buffer
10496
blocks, err = db.Blocks()
10597
if err != nil {

0 commit comments

Comments
 (0)