Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flaky http tests tyrian.HttpTests #199

Open
davesmith00000 opened this issue May 5, 2023 · 9 comments
Open

Flaky http tests tyrian.HttpTests #199

davesmith00000 opened this issue May 5, 2023 · 9 comments

Comments

@davesmith00000
Copy link
Member

They are pretty slow and fail intermittently. Here for example the HEAD test passed, but I've seen it fail too, despite no code changes in that area.

tyrian.HttpTests:
  + HEAD 1.33s
  + POST 1.09s
  + PUT 3.28s
  + PATCH 0.40s
  + DELETE 1.65s
==> X tyrian.HttpTests.GET with headers 0.93s munit.ComparisonFailException: 
@davesmith00000 davesmith00000 changed the title Flakey http tests tyrian.HttpTests Flaky http tests tyrian.HttpTests May 5, 2023
@davesmith00000
Copy link
Member Author

Annoyingly I can't replicate this now. Will leave the issue open a bit longer...

@JPonte
Copy link
Contributor

JPonte commented May 15, 2023

Seems like the tests I added 😞 I wonder if httpbin was having issues at the time? That's the downside of depending on an external service for the unit tests...

@davesmith00000
Copy link
Member Author

Yeah it's being flaky again this morning - no worries though, it's still a massive improvement to have tests for this stuff!

I think maybe I'll just have to switch httpbin out for some sort of mock when I get a chance.

@davesmith00000
Copy link
Member Author

I've disable the tests for now and left the following comment in the code while I have a think about what to do next:

    // These tests work great, but http://httpbin.org is unreliable, it seems.
    // So we either need an HTTP mock server compatible with Scala.js, or to use
    // containers (I'd rather not, but...). In the meantime these failing tests
    // are lowering build confidence, so I've disabled them.

I do want to bring them back though! Just not quite sure how best to proceed. httpbin is available as a Docker image, but I really dislike docker. 😋

@JPonte
Copy link
Contributor

JPonte commented May 17, 2023

Understandable, I also thought about some sbt magic that would start the httpbin container just for the tests but I didn't like the idea and my sbt knowledge is also questionable. I think @armanbilge had some fancy setup in their project with some simple http4s server running only for the tests or something? Maybe we can make an http4sbin 😅

@davesmith00000
Copy link
Member Author

http4sbin

The thought crossed my mind... 😄

@armanbilge
Copy link
Collaborator

httpbin is available as a Docker image, but I really dislike docker.

httpbin is actually a python program, so its available like that as well.

https://pypi.org/project/httpbin/

@davesmith00000
Copy link
Member Author

I happened to be manually testing an http call to httpbin this morning and it was a bit slow. I wonder if we could get away with just having retries with a backoff policy...

@JPonte
Copy link
Contributor

JPonte commented May 20, 2023

Were you thinking of adding the retry policy to the API itself or just for the tests?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants