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
This commit is contained in:
Roman Khimov 2021-07-20 12:06:17 +03:00
parent c88ebaede9
commit 3b19b34122

View file

@ -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
}