Skip to content

Commit

Permalink
Fix intermittent test failure.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkokar committed Feb 14, 2020
1 parent 103e119 commit 5a4cac8
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ import com.hotels.styx.support.serverPort
import com.hotels.styx.support.threadCount
import com.hotels.styx.support.wait
import io.kotlintest.Spec
import io.kotlintest.eventually
import io.kotlintest.matchers.numerics.shouldBeGreaterThan
import io.kotlintest.seconds
import io.kotlintest.shouldBe
import io.kotlintest.specs.FeatureSpec
import java.nio.charset.StandardCharsets.UTF_8
Expand Down Expand Up @@ -82,7 +85,7 @@ class ExecutorSettingsSpec : FeatureSpec() {
threadCount("host-proxy") shouldBe 1
}

scenario("!HostProxy uses default configuration when `executors` are not specified") {
scenario("HostProxy uses default configuration when `executors` are not specified") {
// It is impossible to verify, externally, on what thread HostProxy runs.
// The best we can do is to make sure it still works.
styxServer.restart(configuration = """
Expand Down Expand Up @@ -203,6 +206,9 @@ class ExecutorSettingsSpec : FeatureSpec() {
port: 0
""".trimIndent())

eventually(2.seconds, AssertionError::class.java) {
styxServer().serverPort("http") shouldBeGreaterThan 0
}
val httpPort = styxServer().serverPort("http")

(1..10).map { client.send(get("/").header(HOST, "localhost:$httpPort").build()) }
Expand Down

0 comments on commit 5a4cac8

Please sign in to comment.