temporal icon indicating copy to clipboard operation
temporal copied to clipboard

Unit test for approximateBacklogCounter with mocked taskManager

Open Shivs11 opened this issue 1 year ago • 0 comments

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:

  1. service/matching/backlog_manager_test.go
  2. 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

Shivs11 avatar Apr 22 '24 19:04 Shivs11