diff --git a/packages/playwright-core/src/utils/processLauncher.ts b/packages/playwright-core/src/utils/processLauncher.ts index 184241f8f0..f4222744a7 100644 --- a/packages/playwright-core/src/utils/processLauncher.ts +++ b/packages/playwright-core/src/utils/processLauncher.ts @@ -17,9 +17,9 @@ import * as childProcess from 'child_process'; import * as readline from 'readline'; -import * as path from 'path'; import { isUnderTest } from './'; import { removeFolders } from './fileUtils'; +import { rimraf } from '../utilsBundle'; export type Env = {[key: string]: string | number | boolean | undefined}; @@ -243,13 +243,12 @@ export async function launchProcess(options: LaunchProcessOptions): Promise { - const dirs = process.argv.slice(2); - const errors = await removeFolders(dirs); - for (let i = 0; i < dirs.length; ++i) { - if (errors[i]) { - // eslint-disable-next-line no-console - console.error(`exception while removing ${dirs[i]}: ${errors[i]}`); - } - } -})(); diff --git a/tests/library/signals.spec.ts b/tests/library/signals.spec.ts index 50b34c15e5..85f6d45ca6 100644 --- a/tests/library/signals.spec.ts +++ b/tests/library/signals.spec.ts @@ -42,7 +42,9 @@ test('should close the browser when the node process closes', async ({ startRemo expect(await remoteServer.childExitCode()).toBe(isWindows ? 1 : 0); }); -test('should remove temp dir on process.exit', async ({ startRemoteServer, server }, testInfo) => { +test('should remove temp dir on process.exit', async ({ startRemoteServer, server, platform }, testInfo) => { + test.skip(platform === 'win32', 'Removing user data dir synchronously is blocked on Windows'); + const file = testInfo.outputPath('exit.file'); const remoteServer = await startRemoteServer('launchServer', { url: server.EMPTY_PAGE, exitOnFile: file }); const tempDir = await remoteServer.out('tempDir');