Skip to content

Commit

Permalink
Fixed comments, replaced a testcase check
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahesh V Kelkar authored and Mahesh V Kelkar committed Jul 14, 2016
1 parent 8be77c3 commit 938d3d7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.twitter.finagle.service

import java.net.InetSocketAddress
import com.twitter.conversions.time._
import com.twitter.finagle.Stack.{Params, Role}
import com.twitter.finagle._
Expand Down Expand Up @@ -311,8 +310,8 @@ class FailureAccrualFactory[Req, Rep](
/**
* Exit 'Probing' state (if necessary)
*
* The follow-on operation (i.e. the result of first request while probing) will determine
* whether the factory transitions to Alive (successful) or Dead (unsuccessful).
* The result of the subsequent request will determine whether the factory transitions to
* Alive (successful) or Dead (unsuccessful).
*/
private[this] def stopProbing() = self.synchronized {
state match {
Expand All @@ -337,7 +336,6 @@ class FailureAccrualFactory[Req, Rep](
// (unsuccessful).
stopProbing()

// Invoke service
service(request).respond { rep =>
if (isSuccess(ReqRep(request, rep))) didSucceed()
else didFail()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ class FailureAccrualFactoryTest extends FunSuite with MockitoSugar {
intercept[Exception] {
Await.result(service(123))
}
assert(statsReceiver.counters.get(List("probes")).getOrElse(0) >= 1)
val probeStat = statsReceiver.counters.get(List("probes"))
assert(probeStat.isDefined && probeStat.get >= 1)
}
}
}
Expand Down

0 comments on commit 938d3d7

Please sign in to comment.