Repository navigation
Run Dynamoid tests against AWS Emulator and wait for table deletion in delete_all - #211
Merged
Merged
Conversation
DynamoDB deletes tables asynchronously and rejects creating a table while the table with the same name is being deleted. delete_all called delete_table without waiting, so create_table silently failed and the next operation hit ResourceInUseException. DynamoDB Local deletes tables immediately and hid this, while AWS Emulator keeps tables in DELETING status like DynamoDB.
Deleting and re-creating tables before each example waits for the table deletion, which takes seconds on DynamoDB and AWS Emulator. Truncate the tables of Dynamoid models instead, and remove the delete_all calls in specs which are redundant with the cleanup before each example.
The tables had 5 read and write capacity units, and the tests exceeded the provisioned throughput. DynamoDB Local does not throttle requests, while AWS Emulator throttles them like DynamoDB and the SDK retries with backoff, which slowed the tests down.
Add a job running the tests with Dynamoid ORM against AWS Emulator in addition to DynamoDB Local. AWS Emulator models DynamoDB behaviors that DynamoDB Local does not, such as asynchronous table deletion and provisioned throughput. Use AWS_ENDPOINT_URL as the DynamoDB endpoint when it is set, and start AWS Emulator with --auth off since the tests travel in time with signed requests. Skip the examples filtering by IDs, since AWS Emulator rejects Query on global secondary indexes with filter expressions on the primary key of the table.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Run the Dynamoid tests also against AWS Emulator, and fix a bug that it found.
delete_allof Dynamoid models (bug fix, CHANGELOG 2.7.4). DynamoDB deletes tables asynchronously, so recreating the table could fail and the next operation raisedResourceInUseException. DynamoDB Local deletes tables immediately and hid it; AWS Emulator keeps tables in DELETING like DynamoDB.aws-emulatorjob installs the signature-verified package, starts it with--auth off(it listens only on 127.0.0.1; time-travel specs would otherwise fail SigV4 withRequestTimeTooSkewed), and runs the Dynamoid suite. The Dynamoid endpoint comes fromAWS_ENDPOINT_URLwhen set, otherwise DynamoDB Local onlocalhost:8000. DynamoDB Local stays the default for the matrix.On the emulator, 14 examples tagged
filter_by_dynamodb_primary_keyare skipped: queryingindex_target_key_created_atwith a filter on the table keyid(theidsoption) is rejected withValidationException: Filter Expression can only contain non-primary key attributes. DynamoDB Local and real DynamoDB (checked in us-east-1 on 2026-11-13) accept the same query, so this is an emulator difference.All jobs keep 100% line coverage.
🤖 Generated with Claude Code