From 0a72b19ed243d24d0393dcdb3b873af2714fda28 Mon Sep 17 00:00:00 2001 From: Rogger Valverde Date: Tue, 30 Jul 2024 21:54:55 -0600 Subject: [PATCH] test(clean): fix flaky test (#2680) --- docs/gitbook/bullmq-pro/changelog.md | 18 ++++++++++++++++++ docs/gitbook/changelog.md | 2 +- tests/test_clean.ts | 22 +++++++++------------- 3 files changed, 28 insertions(+), 14 deletions(-) diff --git a/docs/gitbook/bullmq-pro/changelog.md b/docs/gitbook/bullmq-pro/changelog.md index 0907f686ee..33acf49f4f 100644 --- a/docs/gitbook/bullmq-pro/changelog.md +++ b/docs/gitbook/bullmq-pro/changelog.md @@ -1,3 +1,21 @@ +# [7.13.0](https://github.com/taskforcesh/bullmq-pro/compare/v7.12.0...v7.13.0) (2024-07-31) + + +### Bug Fixes + +* **repeatable:** remove repeat hash when removing repeatable job ([#2676](https://github.com/taskforcesh/bullmq/issues/2676)) ([97a297d](https://github.com/taskforcesh/bullmq/commit/97a297d90ad8b27bcddb7db6a8a158acfb549389)) +* **repeatable:** keep legacy repeatables if it exists instead of creating one with new structure ([#2665](https://github.com/taskforcesh/bullmq/issues/2665)) ([93fad41](https://github.com/taskforcesh/bullmq/commit/93fad41a9520961d0e6814d82454bc916a039501)) +* **repeatable:** consider removing legacy repeatable job ([#2658](https://github.com/taskforcesh/bullmq/issues/2658)) fixes [#2661](https://github.com/taskforcesh/bullmq/issues/2661) ([a6764ae](https://github.com/taskforcesh/bullmq/commit/a6764aecb557fb918d061f5e5c2e26e4afa3e8ee)) +* **repeatable:** pass custom key as an args in addRepeatableJob to prevent CROSSSLOT issue ([#2662](https://github.com/taskforcesh/bullmq/issues/2662)) fixes [#2660](https://github.com/taskforcesh/bullmq/issues/2660) ([9d8f874](https://github.com/taskforcesh/bullmq/commit/9d8f874b959e09662985f38c4614b95ab4d5e89c)) + +### Features + +* **repeatable:** new repeatables structure ([#2617](https://github.com/taskforcesh/bullmq/issues/2617)) ref [#2612](https://github.com/taskforcesh/bullmq/issues/2612) fixes [#2399](https://github.com/taskforcesh/bullmq/issues/2399) [#2596](https://github.com/taskforcesh/bullmq/issues/2596) ([8376a9a](https://github.com/taskforcesh/bullmq/commit/8376a9a9007f58ac7eab1a3a1c2f9e7ec373bbd6)) + +### Performance Improvements + +* **worker:** fetch next job on failure ([#2342](https://github.com/taskforcesh/bullmq/issues/2342)) ([f917b80](https://github.com/taskforcesh/bullmq/commit/f917b8090f306c0580aac12f6bd4394fd9ef003d)) + # [7.12.0](https://github.com/taskforcesh/bullmq-pro/compare/v7.11.0...v7.12.0) (2024-07-26) diff --git a/docs/gitbook/changelog.md b/docs/gitbook/changelog.md index 3dd9e05ced..ee86646910 100644 --- a/docs/gitbook/changelog.md +++ b/docs/gitbook/changelog.md @@ -3,7 +3,7 @@ ### Features -* **job:** allow passing a debounce as option ([#2666](https://github.com/taskforcesh/bullmq/issues/2666)) ([163ccea](https://github.com/taskforcesh/bullmq/commit/163ccea19ef48191c4db6da27638ff6fb0080a74)) +* **job:** allow passing debounce as option ([#2666](https://github.com/taskforcesh/bullmq/issues/2666)) ([163ccea](https://github.com/taskforcesh/bullmq/commit/163ccea19ef48191c4db6da27638ff6fb0080a74)) ## [5.10.4](https://github.com/taskforcesh/bullmq/compare/v5.10.3...v5.10.4) (2024-07-26) diff --git a/tests/test_clean.ts b/tests/test_clean.ts index 15050437f7..2e844f4d4a 100644 --- a/tests/test_clean.ts +++ b/tests/test_clean.ts @@ -375,20 +375,16 @@ describe('Cleaner', () => { const client = await queue.client; const keys = await client.keys(`${prefix}:${queue.name}:*`); + const suffixes = keys.map(key => key.split(':')[2]); // Expected keys: meta, id, stalled-check, events, failed and job - expect(keys.length).to.be.eql(8); - for (const key of keys) { - const type = key.split(':')[2]; - expect([ - 'meta', - 'id', - 'stalled-check', - 'events', - 'failed', - 'marker', - tree.job.id!, - ]).to.include(type); - } + expect(suffixes).to.include.members([ + 'meta', + 'id', + 'stalled-check', + 'events', + 'failed', + tree.job.id!, + ]); const parentState = await tree.job.getState(); expect(parentState).to.be.equal('failed');