Merge pull request #8590 from ffranr/test-node-name-in-tmpdir

lntest: add test node name to tmp directory name
This commit is contained in:
Oliver Gugger 2024-04-24 20:06:04 +02:00 committed by GitHub
commit 8ce3622792
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -97,7 +97,12 @@ type HarnessNode struct {
func NewHarnessNode(t *testing.T, cfg *BaseNodeConfig) (*HarnessNode, error) {
if cfg.BaseDir == "" {
var err error
cfg.BaseDir, err = ioutil.TempDir("", "lndtest-node")
// Create a temporary directory for the node's data and logs.
// Use dash suffix as a separator between base name and random
// suffix.
dirBaseName := fmt.Sprintf("lndtest-node-%s-", cfg.Name)
cfg.BaseDir, err = os.MkdirTemp("", dirBaseName)
if err != nil {
return nil, err
}