From 1a9f4cb53543a599794b67e1a631e1ff533f75f8 Mon Sep 17 00:00:00 2001 From: Mikko Karjalainen Date: Wed, 3 Jul 2019 07:29:19 +0100 Subject: [PATCH] Fix TimeoutSpec timing. --- .../src/test/scala/com/hotels/styx/proxy/TimeoutsSpec.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/system-tests/e2e-suite/src/test/scala/com/hotels/styx/proxy/TimeoutsSpec.scala b/system-tests/e2e-suite/src/test/scala/com/hotels/styx/proxy/TimeoutsSpec.scala index 9ee27b357f..a052035342 100644 --- a/system-tests/e2e-suite/src/test/scala/com/hotels/styx/proxy/TimeoutsSpec.scala +++ b/system-tests/e2e-suite/src/test/scala/com/hotels/styx/proxy/TimeoutsSpec.scala @@ -93,6 +93,7 @@ class TimeoutsSpec extends FunSpec } describe("Response timeouts") { + it("should return a 504 if a backend takes longer than the configured response timeout to start returning a response") { val testClient = aggregatingTestClient("localhost", styxServer.httpPort) @@ -101,9 +102,9 @@ class TimeoutsSpec extends FunSpec val slowRequest = new DefaultFullHttpRequest(HTTP_1_1, HttpMethod.GET, "/slowResponseHeader") slowRequest.headers().add(HOST, styxServer.proxyHost) - testClient.write(slowRequest) val responseTime = time { + testClient.write(slowRequest) val response = testClient.waitForResponse().asInstanceOf[FullHttpResponse] assert(response.status() == GATEWAY_TIMEOUT) }