Conversation
|
looks useful :) should be very easy to test it in a isolated manner outside a container configuration. Just start a container with the exunit macro and then construct and call the strategy ? then another test would be to create a special container, maybe an nginx container, that serves a specific html file or something. However it seems to always take a map in the match function. Is it a requirement as the strategy is now that response must be json ? Should it require that? |
|
I did a test-case, verifying the default index.html file from nginx is up.
I don't think at all. You are free to pass headers and a matcher to adjust to your setting. |
|
And I hit a timeout on CI. Quite ironic, it is a But apparently this is a layer lower - any idea for this? |
|
being so random, i try to run them again. they told me nothing. It could be the engine, testcontainers calling the strategy, but meh .. i will think about it |
|
I think what happens is: Tesla makes a request to a non-yet-existing endpoint and waits the timeout for it to return. What we want is: Use the timeout window to retry until the request passes.
And then in the request:
|
|
That might have done it. I think the failures are coming from unrelated tests? (I cannot re-run them) |
|
think there is a direct failure here ** (FunctionClauseError) no function clause matching in Testcontainers.WaitStrategy.Testcontainers.HttpWaitStrategy.validate_response/1 but it could also be wierd corner case, due to timeout of course |
|
i think the toxiproxy containers test is a bit flaky too .. so some flaky tests happen. its a symptom but i dont have time to dig into everything :) i will rerun one more time |
|
copilot suggest this change this defp validate_response({:ok, response}), do: response to this defp validate_response({:ok, response}), do: response |
|
has to be something with that specific elixir version or something ... |
|
ill try to rerun all ;) |
Co-authored-by: Jarl André Hübenthal <jarlah@protonmail.com>
|
copilot suggestion was false. Actually, that's the "case falling through" in the with clause then catched already - but always worth a try when out of options 😂 The weird part: This PR fails on tests, that "never" use the code added in here o_O |
|
Well actually the error disappeared. Its only toxiproxy tests failing. And they failed before from time too. I think you are in the clear. I will look into the failing and irrelevant tests |
|
Marked the toxiproxy test as flaky and updated this pr |
Impl for #236
I originally build this for
Req. Then saw, there is Tesla. I followed their docs to build the client and make a request - I never used tesla before. I checked the response type from tesla and req and they are pretty equal for the response.While I tested this with
Req, this PR is completely untested - but I thought it's good enough to say hello :)