From 696f03c3ecc223c5221f929231bbbb81ae488db6 Mon Sep 17 00:00:00 2001 From: Igor Savin Date: Wed, 27 Sep 2023 23:40:49 +0300 Subject: [PATCH] Try to fix test --- .../amqp/test/publishers/AmqpPermissionPublisher.spec.ts | 5 +++++ packages/amqp/test/utils/channelUtils.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/amqp/test/publishers/AmqpPermissionPublisher.spec.ts b/packages/amqp/test/publishers/AmqpPermissionPublisher.spec.ts index 50bdf857..a282d30e 100644 --- a/packages/amqp/test/publishers/AmqpPermissionPublisher.spec.ts +++ b/packages/amqp/test/publishers/AmqpPermissionPublisher.spec.ts @@ -188,6 +188,11 @@ describe('PermissionPublisher', () => { await diContainer.cradle.amqpConnectionManager.close() await diContainer.cradle.amqpConnectionManager.init() + // wait till we are done reconnecting + await waitAndRetry(() => { + return diContainer.cradle.amqpConnectionManager.getConnectionSync() + }) + let receivedMessage: PERMISSIONS_MESSAGE_TYPE | null = null const consumerChannel = await createSilentChannel( diContainer.cradle.amqpConnectionManager.getConnectionSync()!, diff --git a/packages/amqp/test/utils/channelUtils.ts b/packages/amqp/test/utils/channelUtils.ts index 14f93408..df8b47de 100644 --- a/packages/amqp/test/utils/channelUtils.ts +++ b/packages/amqp/test/utils/channelUtils.ts @@ -5,7 +5,7 @@ export async function createSilentChannel(connection: Connection) { channel.on('close', () => { // consume event }) - channel.on('error', (err) => { + channel.on('error', () => { // consume event })