From f28310af20b94c57d95899f53053400226ddcf9c Mon Sep 17 00:00:00 2001 From: Luke Bakken Date: Wed, 23 Oct 2024 15:39:31 -0700 Subject: [PATCH] * Fix test failures due to not passing `_consumerDispatchConcurrency` correctly to `CreateChannelOptions` --- projects/Test/Common/IntegrationFixture.cs | 6 ++++-- projects/Test/Common/TestConnectionRecoveryBase.cs | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/projects/Test/Common/IntegrationFixture.cs b/projects/Test/Common/IntegrationFixture.cs index f087fda72..aba2464e0 100644 --- a/projects/Test/Common/IntegrationFixture.cs +++ b/projects/Test/Common/IntegrationFixture.cs @@ -64,10 +64,10 @@ public abstract class IntegrationFixture : IAsyncLifetime protected ConnectionFactory _connFactory; protected IConnection _conn; - protected IChannel _channel; - protected static readonly CreateChannelOptions _createChannelOptions = new(publisherConfirmationsEnabled: true, + protected CreateChannelOptions _createChannelOptions = new(publisherConfirmationsEnabled: true, publisherConfirmationTrackingEnabled: true); + protected IChannel _channel; protected static readonly Encoding _encoding = new UTF8Encoding(); protected static readonly int _processorCount = Environment.ProcessorCount; @@ -156,6 +156,8 @@ public virtual async Task InitializeAsync() if (_openChannel) { + _createChannelOptions = new CreateChannelOptions(publisherConfirmationsEnabled: true, + publisherConfirmationTrackingEnabled: true, consumerDispatchConcurrency: _consumerDispatchConcurrency); _channel = await _conn.CreateChannelAsync(_createChannelOptions); } diff --git a/projects/Test/Common/TestConnectionRecoveryBase.cs b/projects/Test/Common/TestConnectionRecoveryBase.cs index a04e3d78a..c6b3fbf2c 100644 --- a/projects/Test/Common/TestConnectionRecoveryBase.cs +++ b/projects/Test/Common/TestConnectionRecoveryBase.cs @@ -340,7 +340,7 @@ public virtual Task PostHandleDeliveryAsync(ulong deliveryTag, } } - protected static async Task SendAndConsumeMessageAsync(IConnection conn, string queue, string exchange, string routingKey) + protected async Task SendAndConsumeMessageAsync(IConnection conn, string queue, string exchange, string routingKey) { using (IChannel ch = await conn.CreateChannelAsync(_createChannelOptions)) {