Skip to content

Commit 73bf897

Browse files
Revert a part of f576362
To send SIGKILL to the process *group* (not just the process itself)
1 parent b8b390a commit 73bf897

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

Sources/CartonCLI/Commands/TestRunners/BrowserTestRunner.swift

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,12 @@ struct BrowserTestRunner: TestRunner {
8484

8585
func launchDriver(executablePath: String) async throws -> (URL, Disposer) {
8686
let address = try await findAvailablePort()
87-
let process = try Foundation.Process.run(
88-
URL(fileURLWithPath: executablePath),
89-
arguments: ["--port=\(address.port!)"]
90-
)
87+
let process = Process(arguments: [
88+
executablePath, "--port=\(address.port!)",
89+
])
9190
terminal.logLookup("Launch WebDriver executable: ", executablePath)
92-
let disposer = {
93-
// Seems like chromedriver doesn't respond to SIGTERM and SIGINT
94-
kill(process.processIdentifier, SIGKILL)
95-
process.waitUntilExit()
96-
}
91+
try process.launch()
92+
let disposer = { process.signal(SIGKILL) }
9793
return (URL(string: "http://\(address.ipAddress!):\(address.port!)")!, disposer)
9894
}
9995

0 commit comments

Comments
 (0)