MCPcopy Create free account
hub / github.com/temporalio/temporal / TestTaskQueueRateLimit

Method TestTaskQueueRateLimit

tests/task_queue_test.go:59–67  ·  view source on GitHub ↗

Not using RunTestWithMatchingBehavior because I want to pass different expected drain times for different configurations

()

Source from the content-addressed store, hash-verified

57
58// Not using RunTestWithMatchingBehavior because I want to pass different expected drain times for different configurations
59func (s *TaskQueueSuite) TestTaskQueueRateLimit() {
60 s.runTaskQueueRateLimitTest(1, 1, 12*time.Second, true) // ~0.75s avg
61 s.runTaskQueueRateLimitTest(1, 1, 12*time.Second, false) // ~1.1s avg
62
63 // Testing multiple partitions with insufficient pollers is too flaky, because token recycling
64 // depends on a process being available to accept the token, so I'm not testing it
65 s.runTaskQueueRateLimitTest(4, 8, 24*time.Second, true) // ~1.6s avg
66 s.runTaskQueueRateLimitTest(4, 8, 24*time.Second, false) // ~6s avg
67}
68
69func (s *TaskQueueSuite) runTaskQueueRateLimitTest(nPartitions, nWorkers int, timeToDrain time.Duration, useNewMatching bool) {
70 s.Run(s.testTaskQueueRateLimitName(nPartitions, nWorkers, useNewMatching), func(s *TaskQueueSuite) {

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected