Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fox #1246 flaky rpm tests #1249

Merged
merged 4 commits into from
Jul 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.2.6
sbt.version=1.2.8
13 changes: 10 additions & 3 deletions src/main/scala/com/typesafe/sbt/packager/rpm/RpmHelper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,17 @@ object RpmHelper {
// RPM outputs to standard error in non-error cases. So just collect all the output, then dump
// it all to either error log or info log depending on the exit status
val outputBuffer = collection.mutable.ArrayBuffer.empty[String]
(sys.process.Process(args, Some(specsDir)) ! sys.process
.ProcessLogger(o => outputBuffer.append(o))) match {
sys.process.Process(args, Some(specsDir)) ! sys.process.ProcessLogger(o => outputBuffer.append(o)) match {
case 0 =>
outputBuffer.foreach(log.info(_))
// Workaround for #1246 - random tests fail with a NullPointerException in the sbt ConsoleLogger
// I wasn't able to reproduce this locally and there aren't any user reports on this, so we catch
// the NPE and log via println
try {
outputBuffer.foreach(log.info(_))
} catch {
case e: NullPointerException =>
outputBuffer.foreach(println(_))
}
case code =>
outputBuffer.foreach(log.error(_))
sys.error("Unable to run rpmbuild, check output for details. Errorcode " + code)
Expand Down