*: create real temporary dirs and files in tests

Improve reliability.
This commit is contained in:
Roman Khimov 2021-07-20 12:32:02 +03:00
parent 3b19b34122
commit 0583f252ab
8 changed files with 77 additions and 59 deletions

View file

@ -12,8 +12,8 @@ import (
)
func TestDBRestore(t *testing.T) {
tmpDir := path.Join(os.TempDir(), "neogo.restoretest")
require.NoError(t, os.Mkdir(tmpDir, os.ModePerm))
tmpDir, err := ioutil.TempDir("", "neogo.restoretest")
require.NoError(t, err)
t.Cleanup(func() {
os.RemoveAll(tmpDir)
})