Tests for Common/Domain: Adding tests for replication queue message handling and ack update #5730
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.
Why?:
The recent updates to the unit tests for GetReplicationMessages and UpdateAckLevel functions aim to improve code reliability and maintainability by ensuring that critical functionality within the replication queue's message handling processes is thoroughly validated.
By simulating scenarios of both successful operations and potential failures, these tests help identify issues early in the development cycle, reducing the likelihood of bugs in production.
Additionally, this contributes to the overall effort to increase test coverage for the Cadence service, supporting future development and refactoring with greater confidence.
What has changed?:
Added comprehensive test cases for the GetReplicationMessages function to verify both successful message retrieval and proper error handling when message reading fails.
Enhanced testing for the UpdateAckLevel function, including scenarios where the ack level update succeeds and fails, ensuring robust error handling and state management.
Mock interactions with the QueueManager are fully simulated to ensure the replication queue's logic correctly processes a variety of situations without direct dependency on external systems.
How did you test it?:
Unit tests
Potential risks:
No risks