spring-projects/spring-aot-smoke-tests

Stabilise tests that use httpbin.org

wilkinsona opened this issue · 1 comments

We use httpbin.org in a number of tests to verify that HTTP clients are working in a native image. These tests are flaky as httpbin.org can be quite slow to respond. This doesn't appear to be specific to CI as testing locally on the command line shows slow response times and gateway timeouts:

$ time http https://httpbin.org/anything
HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Connection: keep-alive
Content-Length: 386
Content-Type: application/json
Date: Wed, 21 Jun 2023 11:00:09 GMT
Server: gunicorn/19.9.0

{
    "args": {},
    "data": "",
    "files": {},
    "form": {},
    "headers": {
        "Accept": "*/*",
        "Accept-Encoding": "gzip, deflate",
        "Host": "httpbin.org",
        "User-Agent": "HTTPie/3.2.1",
        "X-Amzn-Trace-Id": "Root=1-6492d836-216f3e3b4569ea9c44d966c0"
    },
    "json": null,
    "method": "GET",
    "origin": "51.148.140.188",
    "url": "https://httpbin.org/anything"
}


http https://httpbin.org/anything  0.22s user 0.12s system 9% cpu 3.709 total
$ time http https://httpbin.org/anything
HTTP/1.1 504 Gateway Time-out
Connection: keep-alive
Content-Length: 132
Content-Type: text/html
Date: Wed, 21 Jun 2023 11:00:31 GMT
Server: awselb/2.0

<html>
<head><title>504 Gateway Time-out</title></head>
<body>
<center><h1>504 Gateway Time-out</h1></center>
</body>
</html>


http https://httpbin.org/anything  0.22s user 0.13s system 3% cpu 10.996 total

It's now running against a docker-compose service which just echoes the HTTP request back to the caller.