Skip to content

Commit

Permalink
read before destroy
Browse files Browse the repository at this point in the history
  • Loading branch information
restingbull committed Aug 22, 2024
1 parent db74e0d commit e0b9571
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,18 +164,20 @@ object BazelIntegrationTestRunner {
.directory(inDirectory.toFile())
.start()
.let { process ->
if (process.waitFor(10, TimeUnit.MINUTES) && process.exitValue() == 0) {
if (process.waitFor(800, TimeUnit.SECONDS) && process.exitValue() == 0) {
return Result.success(process)
}
val out = process.inputStream.readAllBytes().toString(UTF_8)
val err = process.errorStream.readAllBytes().toString(UTF_8)
process.destroyForcibly()
return Result.failure(
AssertionError(
"""
$this ${args.joinToString(" ")} exited ${process.exitValue()}:
stdout:
${process.inputStream.readAllBytes().toString(UTF_8)}
$out
stderr:
${process.errorStream.readAllBytes().toString(UTF_8)}
$err
""".trimIndent(),
),
)
Expand Down

0 comments on commit e0b9571

Please sign in to comment.