Skip to content

Commit acece57

Browse files
committed
clarify test assertions
1 parent 8e142be commit acece57

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

internal-packages/run-engine/src/batch-queue/tests/index.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ describe("BatchQueue", () => {
662662

663663
describe("global rate limiter at worker queue consumer level", () => {
664664
redisTest(
665-
"should call rate limiter once per item processed",
665+
"should call rate limiter before each processing attempt",
666666
async ({ redisContainer }) => {
667667
let limitCallCount = 0;
668668
const rateLimiter: GlobalRateLimiter = {
@@ -708,8 +708,8 @@ describe("BatchQueue", () => {
708708
);
709709

710710
expect(completionResult!.successfulRunCount).toBe(itemCount);
711-
// Rate limiter should be called at least once per item processed
712-
// (may be called more due to consumer loop iterations with empty pops)
711+
// Rate limiter is called before each blockingPop, including iterations
712+
// where no message is available, so count >= items processed
713713
expect(limitCallCount).toBeGreaterThanOrEqual(itemCount);
714714
} finally {
715715
await queue.close();

0 commit comments

Comments
 (0)