chainntnfs: use T.TempDir to create temporary test directory

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
Eng Zer Jun committed 2022-08-24 08:58:16 +08:00
1 parent 994f4d67a1
commit 712177ee03
5 files changed
+20 -30

No files matched your search

+1 -5
View File
@@ -6,7 +6,6 @@ package chainntnfstest
import (
"bytes"
"fmt"
"io/ioutil"
"log"
"sync"
"testing"
@@ -1833,10 +1832,7 @@ func TestInterfaces(t *testing.T, targetBackEnd string) {
}
// Initialize a height hint cache for each notifier.
tempDir, err := ioutil.TempDir("", "channeldb")
if err != nil {
t.Fatalf("unable to create temp dir: %v", err)
}
tempDir := t.TempDir()
db, err := channeldb.Open(tempDir)
if err != nil {
t.Fatalf("unable to create db: %v", err)