Skip to content

Commit 33eba72

Browse files
modify tmpdir creation
1 parent 41cd617 commit 33eba72

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/test-utils/lib/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import { hideBin } from 'yargs/helpers';
2525

2626
import * as fs from 'node:fs';
2727
import * as os from 'node:os';
28+
import * as path from 'node:path';
2829

2930
interface TestUtilsConfig {
3031
/**
@@ -573,8 +574,11 @@ export default class TestUtils {
573574
): Promise<Array<RedisServerDocker>> {
574575
const sentinels: Array<RedisServerDocker> = [];
575576
for (let i = 0; i < count; i++) {
576-
const tmpDir = fs.mkdtempSync(os.tmpdir())
577+
const appPrefix = 'sentinel-config-dir';
578+
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), appPrefix));
579+
577580
sentinels.push(await spawnSentinelNode(this.#DOCKER_IMAGE, options.serverArguments, masterPort, sentinelName, tmpDir))
581+
578582
if (tmpDir) {
579583
fs.rmSync(tmpDir, { recursive: true });
580584
}

0 commit comments

Comments
 (0)