diff --git a/http-testkit/src/main/resources/reference.conf b/http-testkit/src/main/resources/reference.conf index 3f0707679..f156e194c 100644 --- a/http-testkit/src/main/resources/reference.conf +++ b/http-testkit/src/main/resources/reference.conf @@ -1,3 +1,4 @@ # SPDX-License-Identifier: Apache-2.0 pekko.http.testkit.marshalling.timeout = 1 s +pekko.http.testkit.routes.timeout = 1 s diff --git a/http-testkit/src/main/scala/org/apache/pekko/http/scaladsl/testkit/RouteTestTimeout.scala b/http-testkit/src/main/scala/org/apache/pekko/http/scaladsl/testkit/RouteTestTimeout.scala index 95e0fbaa4..3934fc119 100644 --- a/http-testkit/src/main/scala/org/apache/pekko/http/scaladsl/testkit/RouteTestTimeout.scala +++ b/http-testkit/src/main/scala/org/apache/pekko/http/scaladsl/testkit/RouteTestTimeout.scala @@ -8,7 +8,7 @@ */ /* - * Copyright (C) 2009-2022 Lightbend Inc. + * Copyright (C) 2009-2023 Lightbend Inc. */ package org.apache.pekko.http.scaladsl.testkit @@ -17,10 +17,13 @@ import scala.concurrent.duration._ import org.apache.pekko import pekko.actor.ActorSystem -import pekko.testkit._ +import pekko.http.impl.util.enhanceConfig case class RouteTestTimeout(duration: FiniteDuration) object RouteTestTimeout { - implicit def default(implicit system: ActorSystem): RouteTestTimeout = RouteTestTimeout(1.second.dilated) + implicit def default(implicit system: ActorSystem): RouteTestTimeout = { + val routesTimeout = system.settings.config.getFiniteDuration("pekko.http.testkit.routes.timeout") + RouteTestTimeout(routesTimeout) + } }