Skip to content

Commit

Permalink
Use sys.props to avoid null
Browse files Browse the repository at this point in the history
  • Loading branch information
mcgizzle committed Feb 25, 2022
1 parent a2ec5cc commit ff06057
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions modules/framework/src-jvm/RunnerCompat.scala
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,10 @@ trait RunnerCompat[F[_]] { self: sbt.testing.Runner =>
gate)
stillRunning.set(sbtTasks.size)

val maybeTimeout: Option[FiniteDuration] = Try(System.getProperty("weaver.test.startupTimeout"))
.toOption
.flatMap(Option(_))
.flatMap(timeoutString => Try(timeoutString.toInt).toOption)
.map(_.seconds)
val maybeTimeout: Option[FiniteDuration] =
sys.props.get("weaver.test.startupTimeout")
.flatMap(timeoutString => Try(timeoutString.toInt).toOption)
.map(_.seconds)

// Waiting for the resources to be allocated.
scala.concurrent.blocking {
Expand Down

0 comments on commit ff06057

Please sign in to comment.