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

Add TableNameResolver to tempest2 #179

Merged

Conversation

szabado-faire
Copy link
Contributor

I'm running into a limitation of tempest2 - static table names. This is a limitation that tempest doesn't have, because it allows callers to pass in a DynamoDbMapperConfig that includes either an override or a table name resolver (relevant javadoc)

The AWS v2 client library doesn't support a way of resolving/overriding table names. I think this is because the enhanced client allows you to pass in the table name as a string, removing the need for the v2 client to care about how the name gets resolved. Unfortunately tempest2 uses AWS v1-esque annotations for table names, which prevents callers from leveraging this flexibility.

I figured I'd take a page out of amazon's book and add a TableNameResolver. It seemed like the most flexible way to allow dynamic table names without breaking backwards compatibility.

Why?

We run multiple gradle workers on the same node in order to run tests in parallel. To avoid conflicts across test runs, we prefix dynamo tables and other resources with the test worker number. That's impossible with tempest for obvious reasons, and has led to a high degree of flaky tests on our tempest-based dynamo tables.

Adding a name resolver will let us prefix table names appropriately and avoid flakiness

Copy link
Collaborator

@kyeotic kyeotic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, thanks for putting it together :D

@kyeotic kyeotic merged commit 057472e into cashapp:main May 2, 2024
2 checks passed
@szabado-faire szabado-faire deleted the szabado/apr_25/table_name_resolver branch May 3, 2024 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants