Merge pull request #27045 from chbatey/scalafmt-RC7
Upgrade scalafmt to 2.0.0-RC7
This commit is contained in:
commit
11453aad5d
6 changed files with 39 additions and 44 deletions
|
|
@ -1,4 +1,4 @@
|
|||
version = 2.0.0-RC5
|
||||
version = 2.0.0-RC7
|
||||
|
||||
style = defaultWithAlign
|
||||
|
||||
|
|
|
|||
|
|
@ -131,8 +131,9 @@ class LocalActorRefProviderSpec extends AkkaSpec(LocalActorRefProviderSpec.confi
|
|||
for (i <- 0 until 100) {
|
||||
val address = "new-actor" + i
|
||||
implicit val timeout = Timeout(5 seconds)
|
||||
val actors = for (_ <- 1 to 4)
|
||||
yield Future(system.actorOf(Props(new Actor { def receive = { case _ => } }), address))
|
||||
val actors =
|
||||
for (_ <- 1 to 4)
|
||||
yield Future(system.actorOf(Props(new Actor { def receive = { case _ => } }), address))
|
||||
val set = Set() ++ actors.map(a =>
|
||||
Await.ready(a, timeout.duration).value match {
|
||||
case Some(Success(_: ActorRef)) => 1
|
||||
|
|
|
|||
|
|
@ -298,11 +298,10 @@ trait SchedulerSpec extends BeforeAndAfterEach with DefaultTimeout with Implicit
|
|||
}
|
||||
val latencies = within(10.seconds) {
|
||||
for (i <- 1 to N)
|
||||
yield
|
||||
try expectMsgType[Long]
|
||||
catch {
|
||||
case NonFatal(e) => throw new Exception(s"failed expecting the $i-th latency", e)
|
||||
}
|
||||
yield try expectMsgType[Long]
|
||||
catch {
|
||||
case NonFatal(e) => throw new Exception(s"failed expecting the $i-th latency", e)
|
||||
}
|
||||
}
|
||||
val histogram = latencies.groupBy(_ / 100000000L)
|
||||
for (k <- histogram.keys.toSeq.sorted) {
|
||||
|
|
@ -371,11 +370,10 @@ class LightArrayRevolverSchedulerSpec extends AkkaSpec(SchedulerSpec.testConfRev
|
|||
println(cancelled)
|
||||
val latencies = within(10.seconds) {
|
||||
for (i <- 1 to (N - cancelled))
|
||||
yield
|
||||
try expectMsgType[Long]
|
||||
catch {
|
||||
case NonFatal(e) => throw new Exception(s"failed expecting the $i-th latency", e)
|
||||
}
|
||||
yield try expectMsgType[Long]
|
||||
catch {
|
||||
case NonFatal(e) => throw new Exception(s"failed expecting the $i-th latency", e)
|
||||
}
|
||||
}
|
||||
val histogram = latencies.groupBy(_ / 100000000L)
|
||||
for (k <- histogram.keys.toSeq.sorted) {
|
||||
|
|
|
|||
|
|
@ -37,18 +37,17 @@ class CircuitBreakerMTSpec extends AkkaSpec {
|
|||
def testCallsWithBreaker(): immutable.IndexedSeq[Future[String]] = {
|
||||
val aFewActive = new TestLatch(5)
|
||||
for (_ <- 1 to numberOfTestCalls)
|
||||
yield
|
||||
breaker
|
||||
.withCircuitBreaker(Future {
|
||||
yield breaker
|
||||
.withCircuitBreaker(Future {
|
||||
aFewActive.countDown()
|
||||
Await.ready(aFewActive, 5.seconds.dilated)
|
||||
"succeed"
|
||||
})
|
||||
.recoverWith {
|
||||
case _: CircuitBreakerOpenException =>
|
||||
aFewActive.countDown()
|
||||
Await.ready(aFewActive, 5.seconds.dilated)
|
||||
"succeed"
|
||||
})
|
||||
.recoverWith {
|
||||
case _: CircuitBreakerOpenException =>
|
||||
aFewActive.countDown()
|
||||
Future.successful("CBO")
|
||||
}
|
||||
Future.successful("CBO")
|
||||
}
|
||||
}
|
||||
|
||||
"allow many calls while in closed state with no errors" in {
|
||||
|
|
|
|||
|
|
@ -131,13 +131,12 @@ object StandardMetrics {
|
|||
for {
|
||||
used <- nodeMetrics.metric(HeapMemoryUsed)
|
||||
committed <- nodeMetrics.metric(HeapMemoryCommitted)
|
||||
} yield
|
||||
(
|
||||
nodeMetrics.address,
|
||||
nodeMetrics.timestamp,
|
||||
used.smoothValue.longValue,
|
||||
committed.smoothValue.longValue,
|
||||
nodeMetrics.metric(HeapMemoryMax).map(_.smoothValue.longValue))
|
||||
} yield (
|
||||
nodeMetrics.address,
|
||||
nodeMetrics.timestamp,
|
||||
used.smoothValue.longValue,
|
||||
committed.smoothValue.longValue,
|
||||
nodeMetrics.metric(HeapMemoryMax).map(_.smoothValue.longValue))
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -183,14 +182,13 @@ object StandardMetrics {
|
|||
nodeMetrics: NodeMetrics): Option[(Address, Long, Option[Double], Option[Double], Option[Double], Int)] = {
|
||||
for {
|
||||
processors <- nodeMetrics.metric(Processors)
|
||||
} yield
|
||||
(
|
||||
nodeMetrics.address,
|
||||
nodeMetrics.timestamp,
|
||||
nodeMetrics.metric(SystemLoadAverage).map(_.smoothValue),
|
||||
nodeMetrics.metric(CpuCombined).map(_.smoothValue),
|
||||
nodeMetrics.metric(CpuStolen).map(_.smoothValue),
|
||||
processors.value.intValue)
|
||||
} yield (
|
||||
nodeMetrics.address,
|
||||
nodeMetrics.timestamp,
|
||||
nodeMetrics.metric(SystemLoadAverage).map(_.smoothValue),
|
||||
nodeMetrics.metric(CpuCombined).map(_.smoothValue),
|
||||
nodeMetrics.metric(CpuStolen).map(_.smoothValue),
|
||||
processors.value.intValue)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -117,11 +117,10 @@ trait PersistenceMatchers {
|
|||
nrs = seq.map(_.replaceFirst(prefixes(pos), "").toInt)
|
||||
sortedNrs = nrs.sorted
|
||||
if nrs != sortedNrs
|
||||
} yield
|
||||
MatchResult(
|
||||
false,
|
||||
s"""Messages sequence with prefix ${prefixes(pos)} was not sorted! Was: $seq"""",
|
||||
s"""Messages sequence with prefix ${prefixes(pos)} was sorted! Was: $seq"""")
|
||||
} yield MatchResult(
|
||||
false,
|
||||
s"""Messages sequence with prefix ${prefixes(pos)} was not sorted! Was: $seq"""",
|
||||
s"""Messages sequence with prefix ${prefixes(pos)} was sorted! Was: $seq"""")
|
||||
|
||||
if (results.forall(_.matches)) MatchResult(true, "", "")
|
||||
else results.find(r => !r.matches).get
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue