From 33aa0ba90b923f12bd279c4e0b21f6a03967f2d4 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Thu, 1 Oct 2026 14:42:48 -0400 Subject: [PATCH] test(desktop): make the hung-command test fork whichever shell /bin/sh is Co-Authored-By: Claude Opus 5.5 --- .../amethyst/desktop/nowPlaying/OsNowPlayingReaderTest.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/desktopApp/src/jvmTest/kotlin/com/vitorpamplona/amethyst/desktop/nowPlaying/OsNowPlayingReaderTest.kt b/desktopApp/src/jvmTest/kotlin/com/vitorpamplona/amethyst/desktop/nowPlaying/OsNowPlayingReaderTest.kt index 36b29a93cc..4faf8fb717 100644 --- a/desktopApp/src/jvmTest/kotlin/com/vitorpamplona/amethyst/desktop/nowPlaying/OsNowPlayingReaderTest.kt +++ b/desktopApp/src/jvmTest/kotlin/com/vitorpamplona/amethyst/desktop/nowPlaying/OsNowPlayingReaderTest.kt @@ -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") } }