temporal
temporal copied to clipboard
Unit test for approximateBacklogCounter with mocked taskManager
What changed?
Added unit tests validating the backlog counter under various scenarios:
-
Adding tasks by a single worker
-
Completing tasks by a single worker
-
Workers polling and adding tasks simultaneously (concurrency)
-
Resetting the backlog counter if it does undercount (particularly useful when Cassandra TTL's a task and the backlog Manager has no idea about it)
-
DB failures which lead to TaskQueuePartitionManagers being unloaded.
-
NOTE: Base branch is not updated since the the previously open PR has not been merged. For the purpose of this PR, please only review the following files:
-
service/matching/backlog_manager_test.go -
service/matching/matching_engine_test.go
Why?
To ensure that the counter works as expected.
How did you test it?
Tests itself were added.
Potential risks
None
Is hotfix candidate?
No