Push that TlsSpec timeout a bit up (#28591)
Trying to fix failures #28449 and #25858
This commit is contained in:
parent
ece9e7d92b
commit
0cd63b7996
2 changed files with 10 additions and 7 deletions
|
|
@ -25,6 +25,7 @@ import akka.stream.stage._
|
||||||
import akka.stream.testkit._
|
import akka.stream.testkit._
|
||||||
import akka.stream.testkit.scaladsl.StreamTestKit._
|
import akka.stream.testkit.scaladsl.StreamTestKit._
|
||||||
import akka.testkit.WithLogCapturing
|
import akka.testkit.WithLogCapturing
|
||||||
|
import akka.testkit.TestDuration
|
||||||
import akka.util.ByteString
|
import akka.util.ByteString
|
||||||
import akka.util.JavaVersion
|
import akka.util.JavaVersion
|
||||||
import com.github.ghik.silencer.silent
|
import com.github.ghik.silencer.silent
|
||||||
|
|
@ -58,7 +59,7 @@ object DeprecatedTlsSpec {
|
||||||
def initSslContext(): SSLContext = initWithTrust("/truststore")
|
def initSslContext(): SSLContext = initWithTrust("/truststore")
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is an operator that fires a TimeoutException failure 2 seconds after it was started,
|
* This is an operator that fires a TimeoutException failure after it was started,
|
||||||
* independent of the traffic going through. The purpose is to include the last seen
|
* independent of the traffic going through. The purpose is to include the last seen
|
||||||
* element in the exception message to help in figuring out what went wrong.
|
* element in the exception message to help in figuring out what went wrong.
|
||||||
*/
|
*/
|
||||||
|
|
@ -389,11 +390,12 @@ class DeprecatedTlsSpec extends StreamSpec(DeprecatedTlsSpec.configOverrides) wi
|
||||||
.collect { case SessionBytes(_, b) => b }
|
.collect { case SessionBytes(_, b) => b }
|
||||||
.scan(ByteString.empty)(_ ++ _)
|
.scan(ByteString.empty)(_ ++ _)
|
||||||
.filter(_.nonEmpty)
|
.filter(_.nonEmpty)
|
||||||
.via(new Timeout(6.seconds))
|
.via(new Timeout(10.seconds.dilated))
|
||||||
.dropWhile(_.size < scenario.output.size)
|
.dropWhile(_.size < scenario.output.size)
|
||||||
.runWith(Sink.headOption)
|
.runWith(Sink.headOption)
|
||||||
|
|
||||||
Await.result(output, 8.seconds).getOrElse(ByteString.empty).utf8String should be(scenario.output.utf8String)
|
Await.result(output, 12.seconds.dilated).getOrElse(ByteString.empty).utf8String should be(
|
||||||
|
scenario.output.utf8String)
|
||||||
|
|
||||||
commPattern.cleanup()
|
commPattern.cleanup()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ import akka.stream.scaladsl._
|
||||||
import akka.stream.stage._
|
import akka.stream.stage._
|
||||||
import akka.stream.testkit._
|
import akka.stream.testkit._
|
||||||
import akka.stream.testkit.scaladsl.StreamTestKit._
|
import akka.stream.testkit.scaladsl.StreamTestKit._
|
||||||
|
import akka.testkit.TestDuration
|
||||||
import akka.util.{ ByteString, JavaVersion }
|
import akka.util.{ ByteString, JavaVersion }
|
||||||
import javax.net.ssl._
|
import javax.net.ssl._
|
||||||
import akka.stream.impl.fusing.GraphStages.SimpleLinearGraphStage
|
import akka.stream.impl.fusing.GraphStages.SimpleLinearGraphStage
|
||||||
|
|
@ -419,11 +420,11 @@ class TlsSpec extends StreamSpec(TlsSpec.configOverrides) with WithLogCapturing
|
||||||
.collect { case SessionBytes(_, b) => b }
|
.collect { case SessionBytes(_, b) => b }
|
||||||
.scan(ByteString.empty)(_ ++ _)
|
.scan(ByteString.empty)(_ ++ _)
|
||||||
.filter(_.nonEmpty)
|
.filter(_.nonEmpty)
|
||||||
.via(new Timeout(6.seconds))
|
.via(new Timeout(10.seconds))
|
||||||
.dropWhile(_.size < scenario.output.size)
|
.dropWhile(_.size < scenario.output.size)
|
||||||
.runWith(Sink.headOption)
|
.runWith(Sink.headOption)
|
||||||
|
|
||||||
Await.result(output, 8.seconds).getOrElse(ByteString.empty).utf8String should be(scenario.output.utf8String)
|
Await.result(output, 12.seconds).getOrElse(ByteString.empty).utf8String should be(scenario.output.utf8String)
|
||||||
|
|
||||||
commPattern.cleanup()
|
commPattern.cleanup()
|
||||||
}
|
}
|
||||||
|
|
@ -518,7 +519,7 @@ class TlsSpec extends StreamSpec(TlsSpec.configOverrides) with WithLogCapturing
|
||||||
val inFlow = Flow[SslTlsInbound]
|
val inFlow = Flow[SslTlsInbound]
|
||||||
.collect { case SessionBytes(_, b) => b }
|
.collect { case SessionBytes(_, b) => b }
|
||||||
.scan(ByteString.empty)(_ ++ _)
|
.scan(ByteString.empty)(_ ++ _)
|
||||||
.via(new Timeout(6.seconds))
|
.via(new Timeout(6.seconds.dilated))
|
||||||
.dropWhile(_.size < scenario.output.size)
|
.dropWhile(_.size < scenario.output.size)
|
||||||
|
|
||||||
val f =
|
val f =
|
||||||
|
|
@ -530,7 +531,7 @@ class TlsSpec extends StreamSpec(TlsSpec.configOverrides) with WithLogCapturing
|
||||||
})
|
})
|
||||||
.runWith(Sink.last)
|
.runWith(Sink.last)
|
||||||
|
|
||||||
Await.result(f, 8.second).utf8String should be(scenario.output.utf8String)
|
Await.result(f, 8.second.dilated).utf8String should be(scenario.output.utf8String)
|
||||||
}
|
}
|
||||||
|
|
||||||
"verify hostname" in assertAllStagesStopped {
|
"verify hostname" in assertAllStagesStopped {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue