From 71f82c1198d0a74c18014b08a3586a0f3938e717 Mon Sep 17 00:00:00 2001 From: Marie Idleman Date: Mon, 6 Jan 2025 13:39:35 -0600 Subject: [PATCH] fix treeKill --- test/e2e/infra/code.ts | 5 +++-- test/e2e/infra/processes.ts | 4 ++-- test/e2e/tsconfig.json | 2 ++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/test/e2e/infra/code.ts b/test/e2e/infra/code.ts index c8b7139a20e..2e08d5256c8 100644 --- a/test/e2e/infra/code.ts +++ b/test/e2e/infra/code.ts @@ -5,7 +5,7 @@ import * as cp from 'child_process'; import * as os from 'os'; -import * as treekill from 'tree-kill'; +import treeKill from 'tree-kill'; import { ILogFile } from './driver'; import { Logger, measureAndLog } from './logger'; import { launch as launchPlaywrightBrowser } from './playwrightBrowser'; @@ -13,6 +13,7 @@ import { PlaywrightDriver } from './playwrightDriver'; import { launch as launchPlaywrightElectron } from './playwrightElectron'; import { teardown } from './processes'; + export interface LaunchOptions { codePath?: string; readonly workspacePath: string; @@ -160,7 +161,7 @@ export class Code { this.logger.log('Smoke test exit call did not terminate process after 20s, forcefully exiting the application...'); // no need to await since we're polling for the process to die anyways - treekill(pid, err => { + treeKill(pid, err => { try { process.kill(pid, 0); // throws an exception if the process doesn't exist anymore this.logger.log('Failed to kill Electron process tree:', err?.message); diff --git a/test/e2e/infra/processes.ts b/test/e2e/infra/processes.ts index f111095f12b..d3eb6430f78 100644 --- a/test/e2e/infra/processes.ts +++ b/test/e2e/infra/processes.ts @@ -5,7 +5,7 @@ import { ChildProcess } from 'child_process'; import { promisify } from 'util'; -import * as treekill from 'tree-kill'; +import treeKill from 'tree-kill'; import { Logger } from './logger'; export async function teardown(p: ChildProcess, logger: Logger, retryCount = 3): Promise { @@ -19,7 +19,7 @@ export async function teardown(p: ChildProcess, logger: Logger, retryCount = 3): retries++; try { - return await promisify(treekill)(pid); + return await promisify(treeKill)(pid); } catch (error) { try { process.kill(pid, 0); // throws an exception if the process doesn't exist anymore diff --git a/test/e2e/tsconfig.json b/test/e2e/tsconfig.json index 02cd3a44d7c..51efdeec0c9 100644 --- a/test/e2e/tsconfig.json +++ b/test/e2e/tsconfig.json @@ -1,6 +1,8 @@ { "compilerOptions": { "module": "commonjs", + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, "noImplicitAny": false, "removeComments": false, "preserveConstEnums": true,