Skip to content

Commit

Permalink
Fix TimeoutSpec. (#442)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkokar authored Jul 4, 2019
1 parent 1d07f06 commit d19d420
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)
}
Expand Down

0 comments on commit d19d420

Please sign in to comment.