Unverified Commit a3d64abe authored by Joe Haddad's avatar Joe Haddad Committed by GitHub

Swallow test process kill errors on win32 (#8260)

* Swallow process kill errors

* Strictly look for messsage
parent d4d5ad4b
...@@ -215,7 +215,22 @@ export function buildTS (args = [], cwd, env = {}) { ...@@ -215,7 +215,22 @@ export function buildTS (args = [], cwd, env = {}) {
export async function killApp (instance) { export async function killApp (instance) {
await new Promise((resolve, reject) => { await new Promise((resolve, reject) => {
treeKill(instance.pid, err => { treeKill(instance.pid, err => {
if (err) return reject(err) if (err) {
if (
process.platform === 'win32' &&
typeof err.message === 'string' &&
err.message.includes(`no running instance of the task`)
) {
// Windows throws an error if the process is already dead
//
// Command failed: taskkill /pid 6924 /T /F
// ERROR: The process with PID 6924 (child process of PID 6736) could not be terminated.
// Reason: There is no running instance of the task.
return resolve()
}
return reject(err)
}
resolve() resolve()
}) })
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment