                     let file = tmpdir.appending(component: "pidfile")
                     let waitFile = tmpdir.appending(component: "waitFile")
                     let process = Process(args: self.script("print-pid"), file.pathString, waitFile.pathString)
+                    try processes.add(process)
                     try process.launch()
                     guard waitForFile(waitFile) else {
                         return XCTFail("Couldn't launch the process")


  #if !os(Windows) // Signals are not supported in Windows
    func testSignals() throws {
        let group = DispatchGroup()

        DispatchQueue.global().async(group: group) {

                    let file = tmpdir.appending(component: "pidfile")
                    let waitFile = tmpdir.appending(component: "waitFile")
                    let process = Process(args: self.script("subprocess"), file.pathString, waitFile.pathString)
                    try processes.add(process)
                    try process.launch()
                    guard waitForFile(waitFile) else {
                        return XCTFail("Couldn't launch the process")
