Skip to content

fix: Fix intermittent async test failures for DynamoDB and Redis#6361

Open
ntkathole wants to merge 1 commit intofeast-dev:masterfrom
ntkathole:fix_integration_inter
Open

fix: Fix intermittent async test failures for DynamoDB and Redis#6361
ntkathole wants to merge 1 commit intofeast-dev:masterfrom
ntkathole:fix_integration_inter

Conversation

@ntkathole
Copy link
Copy Markdown
Member

@ntkathole ntkathole commented May 3, 2026

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.

@ntkathole ntkathole self-assigned this May 3, 2026
@ntkathole ntkathole requested a review from a team as a code owner May 3, 2026 05:26
@ntkathole ntkathole force-pushed the fix_integration_inter branch 4 times, most recently from bc250d9 to fcda794 Compare May 3, 2026 09:19
@ntkathole ntkathole changed the title fix: Fixed credential staleness issue in the cached aiobotocore client fix: Fix intermittent async test failures for DynamoDB and Redis May 3, 2026
@ntkathole ntkathole force-pushed the fix_integration_inter branch 7 times, most recently from 9071877 to 96a2e7c Compare May 6, 2026 04:27
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>
@ntkathole ntkathole force-pushed the fix_integration_inter branch from 96a2e7c to 255eded Compare May 6, 2026 05:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant