mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-21 14:07:20 +08:00
test(jetbrains): reap CLI child in kill test
This commit is contained in:
+2
-1
@@ -24,7 +24,8 @@ class KiloBackendCliKillTest {
|
||||
@Test
|
||||
fun `kills a real process tree`() {
|
||||
val log = TestLog()
|
||||
val proc = process("sh", "-c", "sleep 30 & wait")
|
||||
val script = "trap 'kill -TERM \"${'$'}child\" 2>/dev/null; wait \"${'$'}child\"; exit 0' TERM; sleep 30 & child=${'$'}!; wait \"${'$'}child\""
|
||||
val proc = process("sh", "-c", script)
|
||||
try {
|
||||
val kids = descendants(proc)
|
||||
assertTrue(kids.isNotEmpty(), "process tree did not spawn a descendant")
|
||||
|
||||
Reference in New Issue
Block a user