mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-10-05 11:18:24 +00:00
test(desktop): make the hung-command test fork whichever shell /bin/sh is
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
391e371259
commit
33aa0ba90b
+4
-1
@@ -234,7 +234,10 @@ class OsNowPlayingReaderTest {
|
||||
runTest {
|
||||
if (!hasShell) return@runTest
|
||||
val started = System.currentTimeMillis()
|
||||
assertNull(runCommand(listOf("/bin/sh", "-c", "sleep 30"), timeoutSeconds = 1))
|
||||
// `; true` makes every shell fork `sleep` rather than exec it, as dash always does, so the
|
||||
// child that outlives a killed shell is exercised whichever shell /bin/sh is. Only Linux
|
||||
// JDKs then block on the pipe (macOS closes it on destroy): the check bites on Linux CI.
|
||||
assertNull(runCommand(listOf("/bin/sh", "-c", "sleep 30; true"), timeoutSeconds = 1))
|
||||
assertTrue(System.currentTimeMillis() - started < 10_000, "the timeout must end the call")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user