Minor improvement. See #1713

This commit is contained in:
Patrik Nordwall 2012-02-10 10:40:24 +01:00
parent 4a5f5eef21
commit 5b50ca96f2
2 changed files with 13 additions and 3 deletions

View file

@ -128,6 +128,8 @@ public class ZeromqDocTestBase {
system.actorOf(new Props(HeapAlerter.class), "alerter");
//#alerter2
// Let it run for a while to see some output.
// Don't do like this in real tests, this is only doc demonstration.
Thread.sleep(3000L);
}
@ -190,7 +192,7 @@ public class ZeromqDocTestBase {
@Override
public void postRestart(Throwable reason) {
// don't call preStart
// don't call preStart, only schedule once
}
@Override

View file

@ -35,7 +35,13 @@ object ZeromqDocSpec {
val os = ManagementFactory.getOperatingSystemMXBean
val ser = SerializationExtension(context.system)
context.system.scheduler.schedule(1 second, 1 second, self, Tick)
override def preStart() {
context.system.scheduler.schedule(1 second, 1 second, self, Tick)
}
override def postRestart(reason: Throwable) {
// don't call preStart, only schedule once
}
def receive: Receive = {
case Tick
@ -172,7 +178,9 @@ class ZeromqDocSpec extends AkkaSpec("akka.loglevel=INFO") {
system.actorOf(Props[HeapAlerter], name = "alerter")
//#alerter
Thread.sleep(3000)
// Let it run for a while to see some output.
// Don't do like this in real tests, this is only doc demonstration.
3.seconds.sleep()
}