diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1ae6db93f..7896c22af 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,7 +51,7 @@ jobs: creds: ${{ secrets.AZURE_ACI_CREDENTIALS }} enable-AzPSSession: true - name: Setup RabbitMQ - uses: Particular/setup-rabbitmq-action@v1.6.0 + uses: Particular/setup-rabbitmq-action@v1.7.0 with: connection-string-name: RabbitMQTransport_ConnectionString tag: RabbitMQTransport diff --git a/src/NServiceBus.Transport.RabbitMQ.TransportTests/When_changing_concurrency.cs b/src/NServiceBus.Transport.RabbitMQ.TransportTests/When_changing_concurrency.cs index 665dedfd7..75ab33744 100644 --- a/src/NServiceBus.Transport.RabbitMQ.TransportTests/When_changing_concurrency.cs +++ b/src/NServiceBus.Transport.RabbitMQ.TransportTests/When_changing_concurrency.cs @@ -16,6 +16,7 @@ public class When_changing_concurrency : NServiceBusTransportTest public async Task Should_complete_current_message(TransportTransactionMode transactionMode) { var triggeredChangeConcurrency = CreateTaskCompletionSource(); + var sentMessageReceived = CreateTaskCompletionSource(); Task concurrencyChanged = null; int invocationCounter = 0; @@ -30,6 +31,7 @@ await StartPump(async (context, ct) => await task; }, ct); + sentMessageReceived.SetResult(); await triggeredChangeConcurrency.Task; }, (_, _) => @@ -40,8 +42,10 @@ await StartPump(async (context, ct) => transactionMode); await SendMessage(InputQueueName); + await sentMessageReceived.Task; await concurrencyChanged; await StopPump(); + Assert.AreEqual(1, invocationCounter, "message should successfully complete on first processing attempt"); } @@ -62,6 +66,7 @@ await StartPump((context, _) => if (context.Headers.TryGetValue("FromOnError", out var value) && value == bool.TrueString) { sentMessageReceived.SetResult(); + return Task.CompletedTask; } throw new Exception("triggering recoverability pipeline"); @@ -84,9 +89,9 @@ await SendMessage(InputQueueName, transactionMode); await SendMessage(InputQueueName); - await sentMessageReceived.Task; await StopPump(); + Assert.AreEqual(2, invocationCounter, "there should be exactly 2 messages (initial message and new message from onError pipeline)"); } }