Skip to content

Conversation

@nand4011
Copy link
Contributor

@nand4011 nand4011 commented Apr 9, 2025

Add a middleware that lets tests control Momento Local with metadata and can collect metrics about retries.

Add sync and async tests for the fixed count retry strategy.

Update the aio retry interceptor to stop if from ignoring the result of a future in some cases.

Add a make target for local tests.

Add a github action to run the local tests.

@nand4011 nand4011 requested a review from a team April 11, 2025 17:22
Base automatically changed from add-middleware to main April 15, 2025 17:17
@nand4011 nand4011 force-pushed the retry-tests branch 2 times, most recently from 11d42a8 to 1302613 Compare May 1, 2025 05:03
Add sync and async tests for the fixed count retry strategy.

Add a make target for local tests.

Add a github action to run the local tests.

Fix a linter error.
@nand4011 nand4011 marked this pull request as ready for review May 1, 2025 05:37
@nand4011 nand4011 requested a review from anitarua May 1, 2025 05:40
anitarua
anitarua previously approved these changes May 1, 2025
Copy link
Contributor

@anitarua anitarua left a comment

Choose a reason for hiding this comment

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

lgtm!

.PHONY: test-local
## Run the integration tests that require Momento Local
test-local:
@poetry run pytest -m local
Copy link
Contributor

Choose a reason for hiding this comment

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

🎗️ this only runs the momento-local specific tests. In the future we could run the entire test suite against Momento local.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Part of my dilemma when choosing a name for this was that we'll have tests like these that always run against momento local, and the standard integration tests that could run with it. I wasn't sure whether we should separate those. We can solve that problem in the future, I suppose.

Comment on lines +62 to +64
markers = [
"local: tests that require Momento Local",
]
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice!



class MomentoRpcMethod(Enum):
GET = ("_GetRequest", "get")
Copy link
Contributor

Choose a reason for hiding this comment

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

Interesting. I didn't know the enum values could be tuples.



class TestFixedCountRetryStrategyAsync:
@pytest.mark.local
Copy link
Contributor

Choose a reason for hiding this comment

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

TIL

@nand4011 nand4011 merged commit ac7bdb8 into main May 7, 2025
11 checks passed
@nand4011 nand4011 deleted the retry-tests branch May 7, 2025 21:03
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.

5 participants