From 3b19b341228d6baa304f43b1df02042b9daeb893 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Tue, 20 Jul 2021 12:06:17 +0300 Subject: [PATCH] storage: fix memcached test with boltdb store Everything was wrong here, wrong file used, wrong cleanup procedure, the net result is this (and some failing tests from time to time): $ ls -l /tmp/test_bolt_db* | wc -l 30939 --- pkg/core/storage/boltdb_store_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/core/storage/boltdb_store_test.go b/pkg/core/storage/boltdb_store_test.go index e36df6fda..30becef21 100644 --- a/pkg/core/storage/boltdb_store_test.go +++ b/pkg/core/storage/boltdb_store_test.go @@ -12,12 +12,12 @@ func newBoltStoreForTesting(t *testing.T) Store { testFileName := "test_bolt_db" file, err := ioutil.TempFile("", testFileName) t.Cleanup(func() { - err := os.RemoveAll(testFileName) + err := os.RemoveAll(file.Name()) require.NoError(t, err) }) require.NoError(t, err) require.NoError(t, file.Close()) - boltDBStore, err := NewBoltDBStore(BoltDBOptions{FilePath: testFileName}) + boltDBStore, err := NewBoltDBStore(BoltDBOptions{FilePath: file.Name()}) require.NoError(t, err) return boltDBStore }