Skip to content

Commit

Permalink
test: waitUntilReady in test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
roggervalf committed Oct 16, 2024
1 parent 6e20049 commit d0c4015
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/classes/queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -715,12 +715,10 @@ export class Queue<
*
* @param maxCount - Max quantity of jobs to be moved to wait per iteration.
*/
async migrateDeprecatedPausedKey(maxCount: number = 1000): Promise<void> {
async migrateDeprecatedPausedKey(maxCount = 1000): Promise<void> {
let cursor = 0;
do {
cursor = await this.scripts.migrateDeprecatedPausedKey(
maxCount
);
cursor = await this.scripts.migrateDeprecatedPausedKey(maxCount);
} while (cursor);
}
}
2 changes: 1 addition & 1 deletion tests/test_clean.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ describe('Cleaner', () => {
queueName = `test-${v4()}`;
queue = new Queue(queueName, { connection, prefix });
queueEvents = new QueueEvents(queueName, { connection, prefix });
await queueEvents.waitUntilReady();
await queue.waitUntilReady();
await queueEvents.waitUntilReady();
});

afterEach(async function () {
Expand Down
2 changes: 2 additions & 0 deletions tests/test_sandboxed_process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ describe('Sandboxed process using child processes', () => {
queueName = `test-${v4()}`;
queue = new Queue(queueName, { connection, prefix });
queueEvents = new QueueEvents(queueName, { connection, prefix });
await queue.waitUntilReady();
await queueEvents.waitUntilReady();
});

Expand Down Expand Up @@ -696,6 +697,7 @@ function sandboxProcessTests(
drainDelay: 1,
useWorkerThreads,
});
await worker.waitUntilReady();

const completing = new Promise<void>((resolve, reject) => {
worker.on('completed', async (job: Job, value: any) => {
Expand Down

0 comments on commit d0c4015

Please sign in to comment.