Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class SABBrokerSpec

implicit override val patienceConfig: PatienceConfig =
PatienceConfig(
timeout = scaled(Span(30 * testTimeFactor, Seconds)),
interval = scaled(Span(2 * testTimeFactor, Millis))
timeout = scaled(Span(3 * testTimeFactor, Seconds)),
interval = scaled(Span(1 * testTimeFactor, Millis))
)

override protected def afterAll(): Unit = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ class SABExponentialSpec

implicit override val patienceConfig: PatienceConfig =
PatienceConfig(
timeout = scaled(Span(30 * testTimeFactor, Seconds)),
interval = scaled(Span(2 * testTimeFactor, Millis))
timeout = scaled(Span(3 * testTimeFactor, Seconds)),
interval = scaled(Span(1 * testTimeFactor, Millis))
)

override protected def afterAll(): Unit = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class SABReceiveTimeoutSpec

implicit override val patienceConfig: PatienceConfig =
PatienceConfig(
timeout = scaled(Span(30 * testTimeFactor, Seconds)),
interval = scaled(Span(2 * testTimeFactor, Millis))
timeout = scaled(Span(3 * testTimeFactor, Seconds)),
interval = scaled(Span(1 * testTimeFactor, Millis))
)

override protected def afterAll(): Unit = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ class SABBrokerSpec

implicit override val patienceConfig: PatienceConfig =
PatienceConfig(
timeout = scaled(Span(30 * testTimeFactor, Seconds)),
interval = scaled(Span(5 * testTimeFactor, Millis))
timeout = scaled(Span(3 * testTimeFactor, Seconds)),
interval = scaled(Span(1 * testTimeFactor, Millis))
)

Feature("SABBrokerSpec untyped") {
Expand All @@ -62,7 +62,7 @@ class SABBrokerSpec
}
val sabBroker: ActorRef = system.actorOf(Props(new SABBroker(config, failedResponse, isFailed)), sabBrokerName1)
val messagePath: ActorPath = system / sabBrokerName1 / SABSupervisor.name(messageId) / SABActor.name(messageId)
val messageRef: ActorSelection = system.actorSelection(messagePath)
def messageRef: ActorSelection = system.actorSelection(messagePath)

When("Long input")
Then("return success message")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ class SABExponentialSpec

implicit override val patienceConfig: PatienceConfig =
PatienceConfig(
timeout = scaled(Span(30 * testTimeFactor, Seconds)),
interval = scaled(Span(2 * testTimeFactor, Millis))
timeout = scaled(Span(3 * testTimeFactor, Seconds)),
interval = scaled(Span(1 * testTimeFactor, Millis))
)

"SABExponential untyped" - {
Expand Down Expand Up @@ -100,7 +100,7 @@ class SABExponentialSpec
sabBrokerName1
)
val messagePath: ActorPath = system / sabBrokerName1 / SABSupervisor.name(messageId) / SABActor.name(messageId)
val messageRef: ActorSelection = system.actorSelection(messagePath)
def messageRef: ActorSelection = system.actorSelection(messagePath)

val message1 = SABMessage(messageId, "A" * 50, handler)
(sabBroker ? message1).mapTo[String].futureValue shouldBe successMessage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class SABReceiveTimeoutSpec
}
val sabBroker: ActorRef = system.actorOf(Props(new SABBroker(config, failedResponse, isFailed)), sabBrokerName1)
val messagePath: ActorPath = system / sabBrokerName1 / SABSupervisor.name(messageId) / SABActor.name(messageId)
val messageRef: ActorSelection = system.actorSelection(messagePath)
def messageRef: ActorSelection = system.actorSelection(messagePath)

val message1 = SABMessage(messageId, "A" * BoundaryLength, handler)
(sabBroker ? message1).mapTo[String].futureValue shouldBe successMessage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ class ServiceAttackBlockerDirectivesSpec

implicit override val patienceConfig: PatienceConfig =
PatienceConfig(
timeout = scaled(Span(30 * testTimeFactor, Seconds)),
interval = scaled(Span(2 * testTimeFactor, Millis))
timeout = scaled(Span(3 * testTimeFactor, Seconds)),
interval = scaled(Span(1 * testTimeFactor, Millis))
)

override protected def afterAll(): Unit = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import org.scalatest.concurrent.PatienceConfiguration.Timeout
import org.scalatest.concurrent.{ Eventually, ScalaFutures }
import org.scalatest.freespec.AnyFreeSpec
import org.scalatest.matchers.should.Matchers
import org.scalatest.time.{ Millis, Seconds, Span }

import scala.concurrent.duration._
import scala.util.{ Success, Try }
Expand All @@ -25,6 +26,12 @@ class ServiceAttackBlockerDirectivesSpec

val testTimeFactor: Int = sys.env.getOrElse("TEST_TIME_FACTOR", "1").toInt

implicit override val patienceConfig: PatienceConfig =
PatienceConfig(
timeout = scaled(Span(3 * testTimeFactor, Seconds)),
interval = scaled(Span(1 * testTimeFactor, Millis))
)

implicit val timeout: AkkaTimeout = AkkaTimeout((4 * testTimeFactor).seconds)
val clientId = "id-1"
val uri: String => String = prefix => s"/$prefix/$clientId"
Expand Down