Prototype update for SNS tests in #334 #342
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This prototype encapsulates extracting region and profile in a new method on the
BotocoreClient
to allow the client code to look reasonable. It's not quite what I had in mind, but with the current structure it's the best I could come up with in an hour.I also factored out the results list into its own class. It was a bit weird that the client stored the results in itself and then modified itself with
extract_key()
andflatten()
. I simply moved that to a separate class, so subsequent calls to the client don't overwrite the previous results.The test is now working and passing, but it's terribly slow. I tried it for the dev account, and it makes some 3,000 API calls, so you get rate limited and the client waits and retries. When I limit it to 300 subscriptions, it returns quite quickly, but running it for all subscriptions takes ages.
If the general approach seems reasonable, at least as an incremental improvement over the current situation, I can factor out the changes in the client in a separate PR and clean them up a bit.
Related: #334