increase some test timeouts in http, #20607
This commit is contained in:
parent
c66e3a9f02
commit
03fd6ac4b7
4 changed files with 9 additions and 9 deletions
|
|
@ -66,7 +66,7 @@ abstract class CoderSpec extends WordSpec with CodecSpecSupport with Inspectors
|
|||
}
|
||||
"properly round-trip encode/decode an HttpRequest" in {
|
||||
val request = HttpRequest(POST, entity = HttpEntity(largeText))
|
||||
Coder.decode(Coder.encode(request)).toStrict(1.second).awaitResult(1.second) should equal(request)
|
||||
Coder.decode(Coder.encode(request)).toStrict(3.seconds).awaitResult(3.seconds) should equal(request)
|
||||
}
|
||||
|
||||
if (corruptInputCheck) {
|
||||
|
|
@ -121,7 +121,7 @@ abstract class CoderSpec extends WordSpec with CodecSpecSupport with Inspectors
|
|||
Source.single(compressed)
|
||||
.via(Coder.withMaxBytesPerChunk(limit).decoderFlow)
|
||||
.limit(4200).runWith(Sink.seq)
|
||||
.awaitResult(1.second)
|
||||
.awaitResult(3.seconds)
|
||||
|
||||
forAll(resultBs) { bs ⇒
|
||||
bs.length should be < limit
|
||||
|
|
@ -145,7 +145,7 @@ abstract class CoderSpec extends WordSpec with CodecSpecSupport with Inspectors
|
|||
.via(Coder.decoderFlow)
|
||||
.runFold(Seq.empty[Int])(_ :+ _.size)
|
||||
|
||||
sizes shouldEqual sizesAfterRoundtrip.awaitResult(1.second)
|
||||
sizes shouldEqual sizesAfterRoundtrip.awaitResult(3.seconds)
|
||||
}
|
||||
|
||||
extraTests()
|
||||
|
|
@ -153,7 +153,7 @@ abstract class CoderSpec extends WordSpec with CodecSpecSupport with Inspectors
|
|||
|
||||
def encode(s: String) = ourEncode(ByteString(s, "UTF8"))
|
||||
def ourEncode(bytes: ByteString): ByteString = Coder.encode(bytes)
|
||||
def ourDecode(bytes: ByteString): ByteString = Coder.decode(bytes).awaitResult(1.second)
|
||||
def ourDecode(bytes: ByteString): ByteString = Coder.decode(bytes).awaitResult(3.seconds)
|
||||
|
||||
lazy val corruptContent = {
|
||||
val content = encode(largeText).toArray
|
||||
|
|
|
|||
|
|
@ -27,12 +27,12 @@ class DecoderSpec extends WordSpec with CodecSpecSupport {
|
|||
val request = HttpRequest(POST, entity = HttpEntity(smallText), headers = List(`Content-Encoding`(DummyDecoder.encoding)))
|
||||
val decoded = DummyDecoder.decode(request)
|
||||
decoded.headers shouldEqual Nil
|
||||
decoded.entity.toStrict(1.second).awaitResult(1.second) shouldEqual HttpEntity(dummyDecompress(smallText))
|
||||
decoded.entity.toStrict(3.seconds).awaitResult(3.seconds) shouldEqual HttpEntity(dummyDecompress(smallText))
|
||||
}
|
||||
}
|
||||
|
||||
def dummyDecompress(s: String): String = dummyDecompress(ByteString(s, "UTF8")).decodeString("UTF8")
|
||||
def dummyDecompress(bytes: ByteString): ByteString = DummyDecoder.decode(bytes).awaitResult(1.second)
|
||||
def dummyDecompress(bytes: ByteString): ByteString = DummyDecoder.decode(bytes).awaitResult(3.seconds)
|
||||
|
||||
case object DummyDecoder extends StreamDecoder {
|
||||
val encoding = HttpEncodings.compress
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class EncoderSpec extends WordSpec with CodecSpecSupport {
|
|||
val request = HttpRequest(POST, entity = HttpEntity(smallText))
|
||||
val encoded = DummyEncoder.encode(request)
|
||||
encoded.headers shouldEqual List(`Content-Encoding`(DummyEncoder.encoding))
|
||||
encoded.entity.toStrict(1.second).awaitResult(1.second) shouldEqual HttpEntity(dummyCompress(smallText))
|
||||
encoded.entity.toStrict(3.seconds).awaitResult(3.seconds) shouldEqual HttpEntity(dummyCompress(smallText))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@ import akka.http.scaladsl.TestUtils.writeAllText
|
|||
class FileAndResourceDirectivesSpec extends RoutingSpec with Inspectors with Inside {
|
||||
|
||||
// operations touch files, can be randomly hit by slowness
|
||||
implicit val routeTestTimeout = RouteTestTimeout(3.seconds)
|
||||
|
||||
implicit val routeTestTimeout = RouteTestTimeout(3.seconds)
|
||||
|
||||
override def testConfigSource = "akka.http.routing.range-coalescing-threshold = 1"
|
||||
|
||||
"getFromFile" should {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue