Skip to content

armgit / peel

Public Imported from GitHub
0

Uninstall Mac apps with every file they leave behind, and see why each belongs. Free up space, fine-tune macOS, and set up Terminal.

Bound the left behind child test by the child's life, not the suite's

Țugui Dragoșc219fce59190
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/SubprocessTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/SubprocessTests.swift
index 9d5e12db..4233dd66 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/SubprocessTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/SubprocessTests.swift
@@ -147,13 +147,14 @@ struct SubprocessTests {
#expect(await task.value == .failure(.canceled))
}
- /// A process the tool starts can outlive it and keep its pipe open. `run` returns without waiting for it.
+ /// A process the tool starts can outlive it and keep its pipe open. `run` returns without waiting for it. A run
+ /// that waited would last the child's 90 seconds, longer than the rest of the suite can hold this test back.
@Test func doesNotWaitForWhatTheToolLeftRunning() async throws {
let started = ContinuousClock.now
- let output = try await Subprocess.run("/bin/sh", ["-c", "sleep 60 >&1 & echo done"], timeout: 30).get()
+ let output = try await Subprocess.run("/bin/sh", ["-c", "sleep 90 >&1 & echo done"], timeout: 30).get()
#expect(output.text == "done\n")
let took = ContinuousClock.now - started
- #expect(took < .seconds(30), "it waited for a child the tool left behind, \(took) in all")
+ #expect(took < .seconds(90), "it waited for a child the tool left behind, \(took) in all")
}
}