From db74e0d5b0c1692cc40b699491922de8a6047326 Mon Sep 17 00:00:00 2001 From: Corbin McNeely-Smith <58151731+restingbull@users.noreply.github.com> Date: Wed, 21 Aug 2024 17:50:44 -0500 Subject: [PATCH] Implement 10 minute timeout on integration tests --- examples/deps/exclude/6.0.0 | 0 examples/deps/exclude/6.4.0 | 0 .../kotlin/io/bazel/kotlin/test/BazelIntegrationTestRunner.kt | 4 +++- 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 examples/deps/exclude/6.0.0 create mode 100644 examples/deps/exclude/6.4.0 diff --git a/examples/deps/exclude/6.0.0 b/examples/deps/exclude/6.0.0 new file mode 100644 index 000000000..e69de29bb diff --git a/examples/deps/exclude/6.4.0 b/examples/deps/exclude/6.4.0 new file mode 100644 index 000000000..e69de29bb diff --git a/src/main/kotlin/io/bazel/kotlin/test/BazelIntegrationTestRunner.kt b/src/main/kotlin/io/bazel/kotlin/test/BazelIntegrationTestRunner.kt index 9c40296c2..dd2496a86 100644 --- a/src/main/kotlin/io/bazel/kotlin/test/BazelIntegrationTestRunner.kt +++ b/src/main/kotlin/io/bazel/kotlin/test/BazelIntegrationTestRunner.kt @@ -7,6 +7,7 @@ import java.nio.charset.StandardCharsets.UTF_8 import java.nio.file.FileSystems import java.nio.file.Files import java.nio.file.Path +import java.util.concurrent.TimeUnit import java.util.zip.GZIPInputStream import kotlin.io.path.createDirectories import kotlin.io.path.exists @@ -163,9 +164,10 @@ object BazelIntegrationTestRunner { .directory(inDirectory.toFile()) .start() .let { process -> - if (process.waitFor() == 0) { + if (process.waitFor(10, TimeUnit.MINUTES) && process.exitValue() == 0) { return Result.success(process) } + process.destroyForcibly() return Result.failure( AssertionError( """