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

Feature: Mocking firehose failing behavior #1871

Open
zeeshanabid94 opened this issue Oct 11, 2018 · 2 comments
Open

Feature: Mocking firehose failing behavior #1871

zeeshanabid94 opened this issue Oct 11, 2018 · 2 comments

Comments

@zeeshanabid94
Copy link

I have a use case of this sort. I have a function with this signature.

write_to_firehose(data, firehose_name, num_retries)

Inside the function, I use a firehose client that is a global variable. I want to simulate the behavior of firehose failing for num_retries time so that I can check if an exception is raised. Idk if I read the docs right, may be there is already a way to do this. Any guidance would help. If this has not been implemented, then I can look into implementing it.

@spulec
Copy link
Collaborator

spulec commented Oct 15, 2018

We don't currently have a way to do this; open to ideas.

@zeeshanabid94
Copy link
Author

All right, so my use case was the following:
I had a serverless function running on AWS Lambda reading from a stream and pushing to Firehose. PutRecordBatch on firehose is an unreliable call that can Fail completely or Fail partially. I had a retry mechanism in place that I needed to test through unittests. Hence, I had to create successful and failed responses and mock PutRecordBatch method on an empty object

So I figured out:
1- Moto does not have AWS Firehose methods implemented yet.
2- There is no explanation about mocking / simulating failing behavior of API methods.

Proposition:

  • Allow tester to specify the response behavior of API methods on different clients.

Idk if this is a good idea, but let me know what you guys think. It is always great to have conversation with fellow engineers.

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

No branches or pull requests

2 participants