Skip to content

Commit

Permalink
flaky test is consistently failing now. Ignored + comment
Browse files Browse the repository at this point in the history
  • Loading branch information
hochgi committed Dec 2, 2024
1 parent 714ea7e commit f7e1de4
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions zio-http/jvm/src/test/scala/zio/http/ClientHttpsSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package zio.http

import zio._
import zio.test.Assertion._
import zio.test.TestAspect.{flaky, nonFlaky}
import zio.test.TestAspect.{flaky, ignore, nonFlaky}
import zio.test.{TestAspect, assertZIO}

import zio.http.netty.NettyConfig
Expand Down Expand Up @@ -51,15 +51,18 @@ abstract class ClientHttpsSpecBase extends ZIOHttpSpec {
assertZIO(actual)(anything)
},
test("should respond as Bad Request") {
val actual = Client
.batched(Request.get(badRequest))
.map(_.status)
.reject { case Status.ServiceUnavailable =>
new RuntimeException("503 is expected from time to time")
}
.retry(Schedule.exponential(1.second) && Schedule.recurs(5))
val actual = Client.batched(Request.get(badRequest)).map(_.status)
assertZIO(actual)(equalTo(Status.BadRequest))
} @@ flaky /* sometimes we get 503 */,
} @@ ignore /* started getting 503 consistently,
flaky does not help, nor exponential retries.
Either we're being throttled, or the service is under high load.
Regardless, we should not depend on an external service like that.
Luckily, httpbin is available via docker.
So once we make sure to:
$ docker run -p 80:80 kennethreitz/httpbin
before invoking tests, we can un-ignore this test. */,
test("should throw DecoderException for handshake failure") {
val actual = Client.batched(Request.get(untrusted)).exit
assertZIO(actual)(
Expand Down

0 comments on commit f7e1de4

Please sign in to comment.