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

Test retries with toxiproxy #404

Open
JonGerding opened this issue Jul 14, 2022 · 3 comments
Open

Test retries with toxiproxy #404

JonGerding opened this issue Jul 14, 2022 · 3 comments
Labels

Comments

@JonGerding
Copy link

Hi,
i would like to test the retry function of my application which sends up to three HTTP-requests to an external API if it didn't get a response.
Is it possible to implement a function to toxiproxy that it discard the first two requests or a function that toxiproxy discard all requests in a specific period of time x and continues after that.

@miry
Copy link
Contributor

miry commented Jul 14, 2022

It is not possible in current state. Toxiproxy is only TCP proxy.
There are still some old PRs that would partially allow to support HTTP protocol.

There is a good discussion in #215.
There are some suggestion to use https://designer.mocky.io/ or similar.

@miry miry added the question label Jul 14, 2022
@ccoltx
Copy link

ccoltx commented Mar 20, 2023

Does that mean we can test grpc retry using toxiproxy? It uses TCP

@miry
Copy link
Contributor

miry commented Mar 20, 2023

@ccoltx Toxiproxy does not know about content of high level protocol.

There are solutions:

  1. Use toxiproxy client in test to test on Networking level. Example:
Toxiproxy[grpc_server].down do
  GRPC.call # -> Failed with networking problem
  GRPC.call # -> Failed with networking problem
end

GRPC.call # -> Success to setup conneciton and process the request.
  1. Create a new Toxic grpc, that would process incoming requests and do some problems.
    Example: https://github.com/Shopify/toxiproxy/blob/master/_examples/toxics/http_toxic.go

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

No branches or pull requests

3 participants