Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Commit

Permalink
Fix shaky test in OfferReviverActorTest
Browse files Browse the repository at this point in the history
(wait for second subscribe in preStart)
  • Loading branch information
Peter Kolloch committed Aug 14, 2015
1 parent 04e6dae commit 75aa08e
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ import mesosphere.marathon.{ MarathonSchedulerDriverHolder, MarathonSpec }
import org.apache.mesos.SchedulerDriver
import org.mockito.Mockito
import org.scalatest.{ Matchers, GivenWhenThen, BeforeAndAfter }
import org.slf4j.LoggerFactory

import scala.concurrent.duration.FiniteDuration

class OfferReviverActorTest extends MarathonSpec with BeforeAndAfter with GivenWhenThen with Matchers {
private[this] val log = LoggerFactory.getLogger(getClass)

private[this] implicit var actorSystem: ActorSystem = _
private[this] var eventStream: EventStream = _
private[this] var driverHolder: MarathonSchedulerDriverHolder = _
Expand Down Expand Up @@ -115,8 +118,11 @@ class OfferReviverActorTest extends MarathonSpec with BeforeAndAfter with GivenW
delegate = new OfferReviverDelegate(actorRef)

// wait for actor to subscribe to event stream
eventStreamProbe.expectMsgClass(classOf[Logging.Debug])
val subscribeDebugMessage = "subscribing " + actorRef + " to channel " + classOf[SchedulerRegisteredEvent]
eventStreamProbe.expectMsgPF() {
case Logging.Debug(_, _, message) if message.toString.startsWith("subscribing " + actorRef) =>
case Logging.Debug(_, _, `subscribeDebugMessage`) =>
log.info("subscribe has finished")
// noop
}

Expand Down

0 comments on commit 75aa08e

Please sign in to comment.