Read process streams to avoid hanging on Windows in parcelize tests
Could be reproduced with ParcelizeBoxTestGenerated.testKt36658 test.
This commit is contained in:
committed by
TeamCityServer
parent
818bbbbb83
commit
f30980806f
+7
-2
@@ -166,10 +166,15 @@ abstract class AbstractParcelBoxTest : CodegenTestCase() {
|
|||||||
JUNIT_GENERATED_TEST_CLASS_FQNAME
|
JUNIT_GENERATED_TEST_CLASS_FQNAME
|
||||||
).start()
|
).start()
|
||||||
|
|
||||||
|
val out = process.inputStream.bufferedReader().lineSequence().joinToString("\n")
|
||||||
|
val err = process.errorStream.bufferedReader().lineSequence().joinToString("\n")
|
||||||
|
|
||||||
process.waitFor(3, TimeUnit.MINUTES)
|
process.waitFor(3, TimeUnit.MINUTES)
|
||||||
println(process.inputStream.bufferedReader().lineSequence().joinToString("\n"))
|
|
||||||
if (process.exitValue() != 0) {
|
if (process.exitValue() != 0) {
|
||||||
println(process.inputStream.bufferedReader().lineSequence().joinToString("\n"))
|
println(out)
|
||||||
|
println(err)
|
||||||
|
|
||||||
throw AssertionError("Process exited with exit code ${process.exitValue()} \n" + classFileFactory.createText())
|
throw AssertionError("Process exited with exit code ${process.exitValue()} \n" + classFileFactory.createText())
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
+6
-1
@@ -163,9 +163,14 @@ abstract class AbstractParcelizeBoxTest : CodegenTestCase() {
|
|||||||
JUNIT_GENERATED_TEST_CLASS_FQNAME
|
JUNIT_GENERATED_TEST_CLASS_FQNAME
|
||||||
).start()
|
).start()
|
||||||
|
|
||||||
|
val out = process.inputStream.bufferedReader().lineSequence().joinToString("\n")
|
||||||
|
val err = process.errorStream.bufferedReader().lineSequence().joinToString("\n")
|
||||||
|
|
||||||
process.waitFor(3, TimeUnit.MINUTES)
|
process.waitFor(3, TimeUnit.MINUTES)
|
||||||
if (process.exitValue() != 0) {
|
if (process.exitValue() != 0) {
|
||||||
println(process.inputStream.bufferedReader().lineSequence().joinToString("\n"))
|
println(out)
|
||||||
|
println(err)
|
||||||
|
|
||||||
throw AssertionError("Process exited with exit code ${process.exitValue()} \n" + classFileFactory.createText())
|
throw AssertionError("Process exited with exit code ${process.exitValue()} \n" + classFileFactory.createText())
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
Reference in New Issue
Block a user