Note: To be able to run tests with everything ignored or excluded by tags you must not use testconductor
, or helper methods that use testconductor
, from the constructor of your test class. Otherwise the controller node might be shutdown before other nodes have completed and you will see errors like: AskTimeoutException: sending to terminated ref breaks promises
. Using lazy val is fine.
Attributes
- Companion
- object
- Source
- MultiNodeSpec.scala
- Graph
-
- Supertypes
-
trait MultiNodeSpecCallbacksclass TestKittrait TestKitBaseclass Objecttrait Matchableclass AnyShow all
Members list
Type members
Classlikes
Attributes
- Source
- MultiNodeSpec.scala
- Supertypes
-
class Objecttrait Matchableclass Any
Value members
Constructors
Constructor for using arbitrary logic to create the actor system used in the multi node spec (the Config
passed to the creator must be used in the created actor system for the multi node tests to work)
Constructor for using arbitrary logic to create the actor system used in the multi node spec (the Config
passed to the creator must be used in the created actor system for the multi node tests to work)
Attributes
- Source
- MultiNodeSpec.scala
Attributes
- Source
- MultiNodeSpec.scala
Abstract methods
TO BE DEFINED BY USER: Defines the number of participants required for starting the test. This might not be equals to the number of nodes available to the test.
TO BE DEFINED BY USER: Defines the number of participants required for starting the test. This might not be equals to the number of nodes available to the test.
Must be a def
:
def initialParticipants = 5
Attributes
- Source
- MultiNodeSpec.scala
Concrete methods
Enter the named barriers in the order given. Use the remaining duration from the innermost enclosing within
block or the default BarrierTimeout
.
Enter the named barriers in the order given. Use the remaining duration from the innermost enclosing within
block or the default BarrierTimeout
.
Attributes
- Source
- MultiNodeSpec.scala
Enter the named barriers in the order given. Use the remaining duration from the innermost enclosing within
block or the passed max
timeout.
Enter the named barriers in the order given. Use the remaining duration from the innermost enclosing within
block or the passed max
timeout.
Note that the max
timeout is scaled using Duration.dilated, which uses the configuration entry "pekko.test.timefactor".
Attributes
- Source
- MultiNodeSpec.scala
Verify that the running node matches one of the given nodes
Call this after the all test cases have run. NOT after every test case.
Call this after the all test cases have run. NOT after every test case.
Attributes
- Definition Classes
- Source
- MultiNodeSpec.scala
Call this before the start of the test run. NOT before every test case.
Call this before the start of the test run. NOT before every test case.
Attributes
- Definition Classes
- Source
- MultiNodeSpec.scala
Attributes
- Source
- MultiNodeSpec.scala
Query the controller for the transport address of the given node (by role name) and return that as an ActorPath for easy composition:
Query the controller for the transport address of the given node (by role name) and return that as an ActorPath for easy composition:
val serviceA = system.actorSelection(node("master") / "user" / "serviceA")
Attributes
- Source
- MultiNodeSpec.scala
All registered roles
Execute the given block of code only on the given nodes (names according to the roleMap
).
Execute the given block of code only on the given nodes (names according to the roleMap
).
Attributes
- Source
- MultiNodeSpec.scala
Attributes
- Source
- MultiNodeSpec.scala
Override this and return true
to assert that the shutdown of the ActorSystem
was done properly.
Override this and return true
to assert that the shutdown of the ActorSystem
was done properly.
Attributes
- Source
- MultiNodeSpec.scala
Inherited methods
Evaluate the given assert every interval
until exception is thrown or max
timeout is expired.
Evaluate the given assert every interval
until exception is thrown or max
timeout is expired.
Returns the result of last evaluation of the assertion.
If no timeout is given, take it from the innermost enclosing within
block.
Note that the timeout is scaled using Duration.dilated, which uses the configuration entry "pekko.test.timefactor".
Attributes
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Evaluate the given assert every interval
until it does not throw an exception and return the result.
Evaluate the given assert every interval
until it does not throw an exception and return the result.
If the max
timeout expires the last exception is thrown.
If no timeout is given, take it from the innermost enclosing within
block.
Note that the timeout is scaled using Duration.dilated, which uses the configuration entry "pekko.test.timefactor".
Attributes
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Await until the given condition evaluates to true
or the timeout expires, whichever comes first.
Await until the given condition evaluates to true
or the timeout expires, whichever comes first.
If no timeout is given, take it from the innermost enclosing within
block.
Note that the timeout is scaled using Duration.dilated, which uses the configuration entry "pekko.test.timefactor".
Attributes
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Spawns an actor as a child of this test actor with an auto-generated name and stopping supervisor strategy, returning the child's ActorRef.
Spawns an actor as a child of this test actor with an auto-generated name and stopping supervisor strategy, returning the child's ActorRef.
Value parameters
- props
-
Props to create the child actor
Attributes
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Spawns an actor as a child of this test actor with a stopping supervisor strategy, and returns the child's ActorRef.
Spawns an actor as a child of this test actor with a stopping supervisor strategy, and returns the child's ActorRef.
Value parameters
- name
-
Actor name for the child actor
- props
-
Props to create the child actor
Attributes
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Spawns an actor as a child of this test actor with an auto-generated name, and returns the child's ActorRef.
Spawns an actor as a child of this test actor with an auto-generated name, and returns the child's ActorRef.
Value parameters
- props
-
Props to create the child actor
- supervisorStrategy
-
Strategy should decide what to do with failures in the actor.
Attributes
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Spawns an actor as a child of this test actor, and returns the child's ActorRef.
Spawns an actor as a child of this test actor, and returns the child's ActorRef.
Value parameters
- name
-
Actor name for the child actor
- props
-
Props to create the child actor
- supervisorStrategy
-
Strategy should decide what to do with failures in the actor.
Attributes
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Receive one message from the test actor and assert that it equals the given object. Wait time is bounded by the given duration, with an AssertionFailure being thrown in case of timeout.
Receive one message from the test actor and assert that it equals the given object. Wait time is bounded by the given duration, with an AssertionFailure being thrown in case of timeout.
Attributes
- Returns
-
the received object
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Receive one message from the test actor and assert that it equals the given object. Wait time is bounded by the given duration, with an AssertionFailure being thrown in case of timeout.
Receive one message from the test actor and assert that it equals the given object. Wait time is bounded by the given duration, with an AssertionFailure being thrown in case of timeout.
Attributes
- Returns
-
the received object
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Same as expectMsg(remainingOrDefault, obj)
, but correctly treating the timeFactor.
Same as expectMsg(remainingOrDefault, obj)
, but correctly treating the timeFactor.
Attributes
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Receive a number of messages from the test actor matching the given number of classes and assert that for each given class one is received which is of that class (equality, not conformance). This construct is useful when the order in which the objects are received is not fixed. Wait time is bounded by the given duration, with an AssertionFailure being thrown in case of timeout.
Receive a number of messages from the test actor matching the given number of classes and assert that for each given class one is received which is of that class (equality, not conformance). This construct is useful when the order in which the objects are received is not fixed. Wait time is bounded by the given duration, with an AssertionFailure being thrown in case of timeout.
Attributes
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Same as expectMsgAllClassOf(remainingOrDefault, obj...)
, but correctly treating the timeFactor.
Same as expectMsgAllClassOf(remainingOrDefault, obj...)
, but correctly treating the timeFactor.
Attributes
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Receive a number of messages from the test actor matching the given number of classes and assert that for each given class one is received which conforms to that class (and vice versa). This construct is useful when the order in which the objects are received is not fixed. Wait time is bounded by the given duration, with an AssertionFailure being thrown in case of timeout.
Receive a number of messages from the test actor matching the given number of classes and assert that for each given class one is received which conforms to that class (and vice versa). This construct is useful when the order in which the objects are received is not fixed. Wait time is bounded by the given duration, with an AssertionFailure being thrown in case of timeout.
Beware that one object may satisfy all given class constraints, which may be counter-intuitive.
Attributes
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Same as expectMsgAllConformingOf(remainingOrDefault, obj...)
, but correctly treating the timeFactor.
Same as expectMsgAllConformingOf(remainingOrDefault, obj...)
, but correctly treating the timeFactor.
Attributes
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Receive a number of messages from the test actor matching the given number of objects and assert that for each given object one is received which equals it and vice versa. This construct is useful when the order in which the objects are received is not fixed. Wait time is bounded by the given duration, with an AssertionFailure being thrown in case of timeout.
Receive a number of messages from the test actor matching the given number of objects and assert that for each given object one is received which equals it and vice versa. This construct is useful when the order in which the objects are received is not fixed. Wait time is bounded by the given duration, with an AssertionFailure being thrown in case of timeout.
dispatcher ! SomeWork1() dispatcher ! SomeWork2() expectMsgAllOf(1 second, Result1(), Result2())
Attributes
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Same as expectMsgAllOf(remainingOrDefault, obj...)
, but correctly treating the timeFactor.
Same as expectMsgAllOf(remainingOrDefault, obj...)
, but correctly treating the timeFactor.
Attributes
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Receive one message from the test actor and assert that it conforms to one of the given classes. Wait time is bounded by the given duration, with an AssertionFailure being thrown in case of timeout.
Receive one message from the test actor and assert that it conforms to one of the given classes. Wait time is bounded by the given duration, with an AssertionFailure being thrown in case of timeout.
Attributes
- Returns
-
the received object
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Same as expectMsgAnyClassOf(remainingOrDefault, obj...)
, but correctly treating the timeFactor.
Same as expectMsgAnyClassOf(remainingOrDefault, obj...)
, but correctly treating the timeFactor.
Attributes
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Receive one message from the test actor and assert that it equals one of the given objects. Wait time is bounded by the given duration, with an AssertionFailure being thrown in case of timeout.
Receive one message from the test actor and assert that it equals one of the given objects. Wait time is bounded by the given duration, with an AssertionFailure being thrown in case of timeout.
Attributes
- Returns
-
the received object
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Same as expectMsgAnyOf(remainingOrDefault, obj...)
, but correctly treating the timeFactor.
Same as expectMsgAnyOf(remainingOrDefault, obj...)
, but correctly treating the timeFactor.
Attributes
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Receive one message from the test actor and assert that it conforms to the given class. Wait time is bounded by the given duration, with an AssertionFailure being thrown in case of timeout.
Receive one message from the test actor and assert that it conforms to the given class. Wait time is bounded by the given duration, with an AssertionFailure being thrown in case of timeout.
Attributes
- Returns
-
the received object
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Same as expectMsgClass(remainingOrDefault, c)
, but correctly treating the timeFactor.
Same as expectMsgClass(remainingOrDefault, c)
, but correctly treating the timeFactor.
Attributes
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Receive one message from the test actor and assert that the given partial function accepts it. Wait time is bounded by the given duration, with an AssertionFailure being thrown in case of timeout.
Receive one message from the test actor and assert that the given partial function accepts it. Wait time is bounded by the given duration, with an AssertionFailure being thrown in case of timeout.
Use this variant to implement more complicated or conditional processing.
Attributes
- Returns
-
the received object as transformed by the partial function
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Receive one message from the test actor and assert that it conforms to the given type (after erasure). Wait time is bounded by the given duration, with an AssertionFailure being thrown in case of timeout.
Receive one message from the test actor and assert that it conforms to the given type (after erasure). Wait time is bounded by the given duration, with an AssertionFailure being thrown in case of timeout.
Attributes
- Returns
-
the received object
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Same as expectMsgType[T](remainingOrDefault)
, but correctly treating the timeFactor.
Same as expectMsgType[T](remainingOrDefault)
, but correctly treating the timeFactor.
Attributes
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Assert that no message is received. Waits for the default period configured as pekko.test.expect-no-message-default
. That timeout is scaled using the configuration entry "pekko.test.timefactor".
Assert that no message is received. Waits for the default period configured as pekko.test.expect-no-message-default
. That timeout is scaled using the configuration entry "pekko.test.timefactor".
Attributes
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Assert that no message is received for the specified time. Supplied value is not dilated.
Assert that no message is received for the specified time. Supplied value is not dilated.
Attributes
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Receive one message from the test actor and assert that it is the Terminated message of the given ActorRef. Before calling this method, you have to watch
the target actor ref. Wait time is bounded by the given duration, with an AssertionFailure being thrown in case of timeout.
Receive one message from the test actor and assert that it is the Terminated message of the given ActorRef. Before calling this method, you have to watch
the target actor ref. Wait time is bounded by the given duration, with an AssertionFailure being thrown in case of timeout.
Value parameters
- max
-
wait no more than max time, otherwise throw AssertionFailure
- target
-
the actor ref expected to be Terminated
Attributes
- Returns
-
the received Terminated message
- Inherited from:
- (x$1:@unchecked)match{ caset@Terminated(target)=> (t:Terminated) }))">TestKitBase
- Source
- TestKit.scala
Hybrid of expectMsgPF and receiveWhile: receive messages while the partial function matches and returns false. Use it to ignore certain messages while waiting for a specific message.
Hybrid of expectMsgPF and receiveWhile: receive messages while the partial function matches and returns false. Use it to ignore certain messages while waiting for a specific message.
Attributes
- Returns
-
the last received message, i.e. the first one for which the partial function returned true
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Waits for specific message that partial function matches while ignoring all other messages coming in the meantime. Use it to ignore any number of messages while waiting for a specific one.
Waits for specific message that partial function matches while ignoring all other messages coming in the meantime. Use it to ignore any number of messages while waiting for a specific one.
Attributes
- Returns
-
result of applying partial function to the last received message, i.e. the first one for which the partial function is defined
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Ignore all messages in the test actor for which the given partial function returns true.
Ignore all messages in the test actor for which the given partial function returns true.
Attributes
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Stop ignoring messages in the test actor.
Stop ignoring messages in the test actor.
Attributes
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Attributes
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Query queue status.
Obtain current time (System.nanoTime
) as Duration.
Obtain current time (System.nanoTime
) as Duration.
Attributes
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Receive N messages in a row before the given deadline.
Receive N messages in a row before the given deadline.
Attributes
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Same as receiveN(n, remaining)
but correctly taking into account Duration.timeFactor.
Same as receiveN(n, remaining)
but correctly taking into account Duration.timeFactor.
Attributes
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Receive one message from the internal queue of the TestActor. If the given duration is zero, the queue is polled (non-blocking).
Receive one message from the internal queue of the TestActor. If the given duration is zero, the queue is polled (non-blocking).
This method does NOT automatically scale its Duration parameter!
Attributes
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Receive a series of messages until one does not match the given partial function or the idle timeout is met (disabled by default) or the overall maximum duration is elapsed or expected messages count is reached. Returns the sequence of messages.
Receive a series of messages until one does not match the given partial function or the idle timeout is met (disabled by default) or the overall maximum duration is elapsed or expected messages count is reached. Returns the sequence of messages.
Note that it is not an error to hit the max
duration in this case.
One possible use of this method is for testing whether messages of certain characteristics are generated at a certain rate:
test ! ScheduleTicks(100 millis)
val series = receiveWhile(750 millis) {
case Tick(count) => count
}
assert(series == (1 to 7).toList)
Attributes
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Obtain time remaining for execution of the innermost enclosing within
block or throw an AssertionError if no within
block surrounds this call.
Obtain time remaining for execution of the innermost enclosing within
block or throw an AssertionError if no within
block surrounds this call.
Attributes
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Obtain time remaining for execution of the innermost enclosing within
block or missing that it returns the given duration.
Obtain time remaining for execution of the innermost enclosing within
block or missing that it returns the given duration.
Attributes
Obtain time remaining for execution of the innermost enclosing within
block or missing that it returns the properly dilated default for this case from settings (key "pekko.test.single-expect-default").
Obtain time remaining for execution of the innermost enclosing within
block or missing that it returns the properly dilated default for this case from settings (key "pekko.test.single-expect-default").
Attributes
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Install an AutoPilot to drive the testActor: the AutoPilot will be run for each received message and can be used to send or forward messages, etc. Each invocation must return the AutoPilot for the next round.
Install an AutoPilot to drive the testActor: the AutoPilot will be run for each received message and can be used to send or forward messages, etc. Each invocation must return the AutoPilot for the next round.
Attributes
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Shut down an actor system and wait for termination. On failure debug output will be logged about the remaining actors in the system.
Shut down an actor system and wait for termination. On failure debug output will be logged about the remaining actors in the system.
If verifySystemShutdown is true, then an exception will be thrown on failure.
Attributes
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Defines the testActor name.
Attributes
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Have the testActor stop watching someone (i.e. context.unwatch(...)
).
Have the testActor stop watching someone (i.e. context.unwatch(...)
).
Attributes
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Have the testActor watch someone (i.e. context.watch(...)
).
Have the testActor watch someone (i.e. context.watch(...)
).
Attributes
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Same as calling within(0 seconds, max)(f)
.
Same as calling within(0 seconds, max)(f)
.
Attributes
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Execute code block while bounding its execution time between min
and max
. within
blocks may be nested. All methods in this trait which take maximum wait times are available in a version which implicitly uses the remaining time governed by the innermost enclosing within
block.
Execute code block while bounding its execution time between min
and max
. within
blocks may be nested. All methods in this trait which take maximum wait times are available in a version which implicitly uses the remaining time governed by the innermost enclosing within
block.
Note that the timeout is scaled using Duration.dilated, which uses the configuration entry "pekko.test.timefactor", while the min Duration is not.
val ret = within(50 millis) {
test ! "ping"
expectMsgClass(classOf[String])
}
Attributes
- Inherited from:
- TestKitBase
- Source
- TestKit.scala
Deprecated and Inherited methods
Assert that no message is received for the specified time. NOTE! Supplied value is always dilated.
Assert that no message is received for the specified time. NOTE! Supplied value is always dilated.
Attributes
- Deprecated
-
[Since version Akka 2.5.5]
Use expectNoMessage instead - Inherited from:
- TestKitBase
- Source
- TestKit.scala
Assert that no message is received. Waits for the default period configured as pekko.test.expect-no-message-default
. That timeout is scaled using the configuration entry "pekko.test.timefactor".
Assert that no message is received. Waits for the default period configured as pekko.test.expect-no-message-default
. That timeout is scaled using the configuration entry "pekko.test.timefactor".
Attributes
- Deprecated
-
[Since version Akka 2.5.5]
Use expectNoMessage instead - Inherited from:
- TestKitBase
- Source
- TestKit.scala
Concrete fields
Attributes
- Source
- MultiNodeSpec.scala
Attributes
- Source
- MultiNodeSpec.scala
Access to the barriers, failure injection, etc. The extension will have been started either in Conductor or Player mode when the constructor of MultiNodeSpec finishes, i.e. do not call the start*() methods yourself!
Access to the barriers, failure injection, etc. The extension will have been started either in Conductor or Player mode when the constructor of MultiNodeSpec finishes, i.e. do not call the start*() methods yourself!
Attributes
- Source
- MultiNodeSpec.scala
Inherited fields
ActorRef of the test actor. Access is provided to enable e.g. registration as message target.
ActorRef of the test actor. Access is provided to enable e.g. registration as message target.
Attributes
Implicits
Implicits
Enrich .await()
onto all Awaitables, using remaining duration from the innermost enclosing within
block or QueryTimeout.
Enrich .await()
onto all Awaitables, using remaining duration from the innermost enclosing within
block or QueryTimeout.
Attributes
- Source
- MultiNodeSpec.scala
Inherited implicits
Attributes
- Inherited from:
- TestKit
- Source
- TestKit.scala