Skip to content

Commit

Permalink
HARMONY-1651: Add one more test for when there are no work schedulers…
Browse files Browse the repository at this point in the history
… running.
  • Loading branch information
chris-durbin committed Dec 7, 2023
1 parent bcaead1 commit 71f4fbd
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions services/work-scheduler/test/scheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,19 +190,26 @@ describe('Scheduler Worker', async function () {
});
});

describe('when there are no workers running and no messages queued', function () {
describe('when there are no service workers running and no messages queued', function () {
it('will queue exactly one message', function () {
const actual = calculateNumItemsToQueue(0, 0, 0, 1.1);
const actual = calculateNumItemsToQueue(0, 1, 0, 1.1);
expect(actual).to.equal(1);
});
});

describe('when there are no workers running and 1 message queued', function () {
describe('when there are no service workers running and 1 message queued', function () {
it('queues zero items', function () {
const actual = calculateNumItemsToQueue(0, 0, 1, 1.1);
expect(actual).to.equal(0);
});
});

describe('when there are no schedulers running and no messages queued', function () {
it('treats it as if there is 1 scheduler running', function () {
const actual = calculateNumItemsToQueue(100, 0, 0, 1);
expect(actual).to.equal(100);
});
});
});
});

0 comments on commit 71f4fbd

Please sign in to comment.