Skip to content

Commit 8f8cb88

Browse files
authored
test(dragonfly): fix flaky test when getting worker rawnames(#2445)
1 parent 651d086 commit 8f8cb88

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tests/test_getters.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,14 @@ describe('Jobs getters', function () {
120120
const nextWorkers = await queue.getWorkers();
121121
expect(nextWorkers).to.have.length(2);
122122

123+
const rawnames = nextWorkers.map(nextWorker => {
124+
const workerValues = nextWorker.rawname.split(':');
125+
return workerValues[workerValues.length - 1];
126+
});
127+
123128
// Check that the worker names are included in the response on the rawname property
124-
expect(nextWorkers[0].rawname.endsWith('worker1')).to.be.true;
125-
expect(nextWorkers[1].rawname.endsWith('worker2')).to.be.true;
129+
expect(rawnames).to.include('worker1');
130+
expect(rawnames).to.include('worker2');
126131

127132
await worker.close();
128133
await worker2.close();

0 commit comments

Comments
 (0)