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:
parent
c88ebaede9
commit
3b19b34122
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue