diff --git a/lntest/itest/lnd_channel_backup_test.go b/lntest/itest/lnd_channel_backup_test.go index 2ebabaeb7..9895d9dbb 100644 --- a/lntest/itest/lnd_channel_backup_test.go +++ b/lntest/itest/lnd_channel_backup_test.go @@ -569,11 +569,7 @@ func testChannelBackupUpdates(net *lntest.NetworkHarness, t *harnessTest) { // First, we'll make a temp directory that we'll use to store our // backup file, so we can check in on it during the test easily. - backupDir, err := ioutil.TempDir("", "") - if err != nil { - t.Fatalf("unable to create backup dir: %v", err) - } - defer os.RemoveAll(backupDir) + backupDir := t.t.TempDir() // First, we'll create a new node, Carol. We'll also create a temporary // file that Carol will use to store her channel backups. diff --git a/lntest/itest/lnd_etcd_failover_test.go b/lntest/itest/lnd_etcd_failover_test.go index 3be233303..4de2d4490 100644 --- a/lntest/itest/lnd_etcd_failover_test.go +++ b/lntest/itest/lnd_etcd_failover_test.go @@ -5,7 +5,6 @@ package itest import ( "context" - "io/ioutil" "testing" "time" @@ -68,12 +67,8 @@ func testEtcdFailoverCase(net *lntest.NetworkHarness, ht *harnessTest, ctxb := context.Background() - tmpDir, err := ioutil.TempDir("", "etcd") - if err != nil { - ht.Fatalf("Failed to create temp dir: %v", err) - } etcdCfg, cleanup, err := kvdb.StartEtcdTestBackend( - tmpDir, uint16(lntest.NextAvailablePort()), + ht.t.TempDir(), uint16(lntest.NextAvailablePort()), uint16(lntest.NextAvailablePort()), "", ) if err != nil {