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 {
|
"properly round-trip encode/decode an HttpRequest" in {
|
||||||
val request = HttpRequest(POST, entity = HttpEntity(largeText))
|
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) {
|
if (corruptInputCheck) {
|
||||||
|
|
@ -121,7 +121,7 @@ abstract class CoderSpec extends WordSpec with CodecSpecSupport with Inspectors
|
||||||
Source.single(compressed)
|
Source.single(compressed)
|
||||||
.via(Coder.withMaxBytesPerChunk(limit).decoderFlow)
|
.via(Coder.withMaxBytesPerChunk(limit).decoderFlow)
|
||||||
.limit(4200).runWith(Sink.seq)
|
.limit(4200).runWith(Sink.seq)
|
||||||
.awaitResult(1.second)
|
.awaitResult(3.seconds)
|
||||||
|
|
||||||
forAll(resultBs) { bs ⇒
|
forAll(resultBs) { bs ⇒
|
||||||
bs.length should be < limit
|
bs.length should be < limit
|
||||||
|
|
@ -145,7 +145,7 @@ abstract class CoderSpec extends WordSpec with CodecSpecSupport with Inspectors
|
||||||
.via(Coder.decoderFlow)
|
.via(Coder.decoderFlow)
|
||||||
.runFold(Seq.empty[Int])(_ :+ _.size)
|
.runFold(Seq.empty[Int])(_ :+ _.size)
|
||||||
|
|
||||||
sizes shouldEqual sizesAfterRoundtrip.awaitResult(1.second)
|
sizes shouldEqual sizesAfterRoundtrip.awaitResult(3.seconds)
|
||||||
}
|
}
|
||||||
|
|
||||||
extraTests()
|
extraTests()
|
||||||
|
|
@ -153,7 +153,7 @@ abstract class CoderSpec extends WordSpec with CodecSpecSupport with Inspectors
|
||||||
|
|
||||||
def encode(s: String) = ourEncode(ByteString(s, "UTF8"))
|
def encode(s: String) = ourEncode(ByteString(s, "UTF8"))
|
||||||
def ourEncode(bytes: ByteString): ByteString = Coder.encode(bytes)
|
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 = {
|
lazy val corruptContent = {
|
||||||
val content = encode(largeText).toArray
|
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 request = HttpRequest(POST, entity = HttpEntity(smallText), headers = List(`Content-Encoding`(DummyDecoder.encoding)))
|
||||||
val decoded = DummyDecoder.decode(request)
|
val decoded = DummyDecoder.decode(request)
|
||||||
decoded.headers shouldEqual Nil
|
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(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 {
|
case object DummyDecoder extends StreamDecoder {
|
||||||
val encoding = HttpEncodings.compress
|
val encoding = HttpEncodings.compress
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ class EncoderSpec extends WordSpec with CodecSpecSupport {
|
||||||
val request = HttpRequest(POST, entity = HttpEntity(smallText))
|
val request = HttpRequest(POST, entity = HttpEntity(smallText))
|
||||||
val encoded = DummyEncoder.encode(request)
|
val encoded = DummyEncoder.encode(request)
|
||||||
encoded.headers shouldEqual List(`Content-Encoding`(DummyEncoder.encoding))
|
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 {
|
class FileAndResourceDirectivesSpec extends RoutingSpec with Inspectors with Inside {
|
||||||
|
|
||||||
// operations touch files, can be randomly hit by slowness
|
// 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"
|
override def testConfigSource = "akka.http.routing.range-coalescing-threshold = 1"
|
||||||
|
|
||||||
"getFromFile" should {
|
"getFromFile" should {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue