From 014705618fbcf5a0a549900206d2959669142bf1 Mon Sep 17 00:00:00 2001 From: Manuel Astudillo Date: Mon, 6 Nov 2023 15:08:40 +0100 Subject: [PATCH] test: replaced localhost for proper connection --- tests/test_connection.ts | 16 +++++++--------- tests/test_rate_limiter.ts | 2 +- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/tests/test_connection.ts b/tests/test_connection.ts index 9a448d39a7..08b80c1dcd 100644 --- a/tests/test_connection.ts +++ b/tests/test_connection.ts @@ -25,7 +25,7 @@ describe('connection', () => { beforeEach(async function () { queueName = `test-${v4()}`; - queue = new Queue(queueName, { connection: { host: 'localhost' }, prefix }); + queue = new Queue(queueName, { connection, prefix }); }); afterEach(async function () { @@ -68,11 +68,10 @@ describe('connection', () => { describe('blocking', () => { it('should override maxRetriesPerRequest: null as redis options', async () => { + connection = new IORedis(redisHost, { maxRetriesPerRequest: 20 }); + const queue = new QueueBase(queueName, { - connection: { - host: 'localhost', - maxRetriesPerRequest: 20, - }, + connection, }); const options = (await queue.client).options; @@ -83,11 +82,10 @@ describe('connection', () => { describe('non-blocking', () => { it('should not override any redis options', async () => { + connection = new IORedis(redisHost, { maxRetriesPerRequest: 20 }); + const queue = new QueueBase(queueName, { - connection: { - host: 'localhost', - maxRetriesPerRequest: 20, - }, + connection, blockingConnection: false, }); diff --git a/tests/test_rate_limiter.ts b/tests/test_rate_limiter.ts index a2cb1bf6d8..1239599532 100644 --- a/tests/test_rate_limiter.ts +++ b/tests/test_rate_limiter.ts @@ -127,7 +127,7 @@ describe('Rate Limiter', function () { it('should quickly close a worker even with slow rate-limit', async function () { const limiter = { max: 1, duration: 60 * 1000 }; const worker = new Worker(queueName, async () => {}, { - connection: { host: 'localhost' }, + connection, prefix, limiter, });