From 0ce7a10a3e25e7c7ccce997b7a0b9657bc4fe22d Mon Sep 17 00:00:00 2001 From: StephenButtolph Date: Tue, 25 May 2021 01:13:53 -0400 Subject: [PATCH] fix unit test --- database/manager/manager_test.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/database/manager/manager_test.go b/database/manager/manager_test.go index ab08a46c4a76..48f28393789f 100644 --- a/database/manager/manager_test.go +++ b/database/manager/manager_test.go @@ -108,11 +108,17 @@ func TestNewInvalidMemberPresent(t *testing.T) { err = db1.Close() assert.NoError(t, err) - _, err = os.Create(path.Join(dir, "dummy")) + f, err := os.Create(path.Join(dir, "dummy")) assert.NoError(t, err) - _, err = New(dir, logging.NoLog{}, v1, true) + err = f.Close() + assert.NoError(t, err) + + db, err := New(dir, logging.NoLog{}, v1, true) assert.NoError(t, err, "expected not to error with a non-directory file being present") + + err = db.Close() + assert.NoError(t, err) } func TestNewSortsDatabases(t *testing.T) {