Skip to content

Commit

Permalink
reduce timeout to 100ms in DefaultStreamForwarderTest.streamWithTimeout
Browse files Browse the repository at this point in the history
Signed-off-by: Cai Yufei <Yufei.Cai@bosch-si.com>
  • Loading branch information
yufei-cai committed Dec 14, 2017
1 parent 5834488 commit 4bd7a6b
Showing 1 changed file with 8 additions and 4 deletions.
Expand Up @@ -67,7 +67,7 @@ public void tearDownBase() {
public void streamWithTimeout() {
new TestKit(actorSystem) {
{
final ActorRef streamForwarder = createStreamForwarder();
final ActorRef streamForwarder = createStreamForwarder(Duration.ofMillis(100));
watch(streamForwarder);

streamForwarder.tell(KNOWN_TAG_1, ActorRef.noSender());
Expand Down Expand Up @@ -143,12 +143,16 @@ private StreamAck failureResponse(final String tag) {
return StreamAck.failure(tag);
}

private ActorRef createStreamForwarder() {
private ActorRef createStreamForwarder(final Duration maxIdleTime) {
// for simplicity, just use String as elementClass
final Props props = DefaultStreamForwarder.props(recipient.ref(), completionRecipient.ref(), MAX_IDLE_TIME,
final Props props = DefaultStreamForwarder.props(recipient.ref(), completionRecipient.ref(), maxIdleTime,
String.class, String::toString);

return actorSystem.actorOf(props);
}

}
private ActorRef createStreamForwarder() {
return createStreamForwarder(MAX_IDLE_TIME);
}

}

0 comments on commit 4bd7a6b

Please sign in to comment.