fix: Fix intermittent async test failures for DynamoDB and Redis#6361
Open
ntkathole wants to merge 1 commit intofeast-dev:masterfrom
Open
fix: Fix intermittent async test failures for DynamoDB and Redis#6361ntkathole wants to merge 1 commit intofeast-dev:masterfrom
ntkathole wants to merge 1 commit intofeast-dev:masterfrom
Conversation
bc250d9 to
fcda794
Compare
9071877 to
96a2e7c
Compare
DynamoDB (integration tests): - Add conftest.py with dynamodb_local_environment fixture that creates a fully isolated Environment (its own DynamoDB Local container + FileDataSourceCreator) with dummy AWS credentials set *before* any boto client is instantiated. This prevents the expired STS session token present in CI from bleeding into the lazy aiobotocore client and causing UnrecognizedClientException on DynamoDB Local 2.x. - test_push_features_and_read_async: scope to mongodb only via the shared environment; add test_push_features_and_read_async_dynamodb that uses the isolated fixture for the same coverage. - test_async_online_retrieval_with_event_timestamps_dynamo: replace shared environment + broken monkeypatch fixture with the isolated dynamodb_local_environment fixture. Redis (unit test): - Replace asyncio.get_event_loop().run_until_complete() with asyncio.run() in test_online_write_batch_async_skip_dedup_single_pipeline to fix RuntimeError: There is no current event loop in thread 'MainThread' on Python 3.10+. Signed-off-by: ntkathole <nikhilkathole2683@gmail.com>
96a2e7c to
255eded
Compare
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.
What this PR does / why we need it:
This PR fixes intermittent failures in integration tests failing with
botocore.exceptions.ClientError: An error occurred (UnrecognizedClientException) when calling the BatchWriteItem operation: The security token included in the request is invalid.This error is a credential staleness issue in the cached aiobotocore client.
Also fixes redis tests eventloop issue.