From 784f9d120bf76c148edf4808823023bc60336bed Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Mon, 25 Sep 2017 22:41:19 +0200 Subject: [PATCH] what did I do to deserve this #34988 --- test/smoke/src/main.ts | 4 ++-- test/smoke/src/spectron/application.ts | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/test/smoke/src/main.ts b/test/smoke/src/main.ts index 7432ef8ea16..f57e72532f7 100644 --- a/test/smoke/src/main.ts +++ b/test/smoke/src/main.ts @@ -12,7 +12,7 @@ import * as tmp from 'tmp'; import * as rimraf from 'rimraf'; import * as mkdirp from 'mkdirp'; -const tmpDir = tmp.dirSync() as { name: string; removeCallback: Function; }; +const tmpDir = tmp.dirSync({ prefix: 't' }) as { name: string; removeCallback: Function; }; const testDataPath = tmpDir.name; process.once('exit', () => rimraf.sync(testDataPath)); @@ -76,7 +76,7 @@ if (!fs.existsSync(testCodePath)) { fail(`Can't find Code at ${testCodePath}.`); } -process.env.VSCODE_USER_DIR = path.join(testDataPath, 'user-dir'); +process.env.VSCODE_USER_DIR = path.join(testDataPath, 'd'); process.env.VSCODE_EXTENSIONS_DIR = extensionsPath; process.env.SMOKETEST_REPO = testRepoLocalDir; process.env.VSCODE_WORKSPACE_PATH = workspacePath; diff --git a/test/smoke/src/spectron/application.ts b/test/smoke/src/spectron/application.ts index abdeb24ff01..b0859d80968 100644 --- a/test/smoke/src/spectron/application.ts +++ b/test/smoke/src/spectron/application.ts @@ -45,6 +45,8 @@ export async function findFreePort(): Promise { */ export class SpectronApplication { + private static count = 0; + private _client: SpectronClient; private _workbench: Workbench; private _screenCapturer: ScreenCapturer; @@ -133,7 +135,7 @@ export class SpectronApplication { args.push(...codeArgs); - chromeDriverArgs.push(`--user-data-dir=${path.join(this._userDir, new Date().getTime().toString())}`); + chromeDriverArgs.push(`--user-data-dir=${path.join(this._userDir, String(SpectronApplication.count++))}`); // Spectron always uses the same port number for the chrome driver // and it handles gracefully when two instances use the same port number -- GitLab