Replace httpbin.org in all examples and tests
algesten opened this issue · comments
It's become almost impossible to get a clean build through the github actions.
The error is a bit strange (which should be looked at in isolation), but it basically boils down to Connection reset by peer
. I don't know if they are maybe throttling. Re-running failed github actions means it's possible to "grind" through the tests until all are green.
stderr:
Error: Transport(Transport { kind: Io, message: None, url: Some(Url { scheme: "http", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("httpbin.org")), port: None, path: "/post", query: None, fragment: None }), source: Some(Custom { kind: ConnectionReset, error: Transport(Transport { kind: Io, message: Some("Error encountered in a header"), url: None, source: Some(Os { code: 104, kind: ConnectionReset, message: "Connection reset by peer" }) }) }) })
We need a better solve for this. Something not depending on 3rd parties.
One solution would be to start an httpbin container with the CI. There would be a problem with the HTTPS certificate verification but it can be worked around.
This way we are sure that when GitHub CI is available, tests can be run against this local container.
My preferred solution is to port more of the tests and doctests to use test_agent
, which starts a little HTTP server within the test runner and talks to that.
Oh I didn't know there was this in the project.
I've looked at what would be needed to resolve this issue and I have some questions:
- Do the examples in the
examples
folder have to be changed ? - In the doctests, does the initialization of the test server need to be shown in the rendered documentation ?
I've been busy the last couple of weekends exploring a new API for "correct" no_std HTTP library. I call it hoot
(https://crates.io/crates/hoot). I have addressed this issue using it.
See PR #703