Revert a part of f576362845

To send SIGKILL to the process *group* (not just the process itself)
This commit is contained in:
Yuta Saito 2024-03-26 14:21:55 +09:00
parent b8b390add1
commit 73bf897e24
1 changed files with 5 additions and 9 deletions

View File

@ -84,16 +84,12 @@ struct BrowserTestRunner: TestRunner {
func launchDriver(executablePath: String) async throws -> (URL, Disposer) {
let address = try await findAvailablePort()
let process = try Foundation.Process.run(
URL(fileURLWithPath: executablePath),
arguments: ["--port=\(address.port!)"]
)
let process = Process(arguments: [
executablePath, "--port=\(address.port!)",
])
terminal.logLookup("Launch WebDriver executable: ", executablePath)
let disposer = {
// Seems like chromedriver doesn't respond to SIGTERM and SIGINT
kill(process.processIdentifier, SIGKILL)
process.waitUntilExit()
}
try process.launch()
let disposer = { process.signal(SIGKILL) }
return (URL(string: "http://\(address.ipAddress!):\(address.port!)")!, disposer)
}