This is an automated email from the ASF dual-hosted git repository.

blankensteiner pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar-dotpulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new fa91e33  Having run the tests multiple times locally it seems very 
random whether the broker will allow an already connected producer with 
"Shared" access mode to stay connected and fench the competing 
"ExclusiveWithFencing" producer or if the latter wins and "Disconnect" the 
shared producer. Therefore the test is disabled.
fa91e33 is described below

commit fa91e33ba5361982dc98e337230dbf9b97cb19da
Author: Daniel Blankensteiner <[email protected]>
AuthorDate: Fri Oct 13 15:33:29 2023 +0200

    Having run the tests multiple times locally it seems very random whether 
the broker will allow an already connected producer with "Shared" access mode 
to stay connected and fench the competing "ExclusiveWithFencing" producer or if 
the latter wins and "Disconnect" the shared producer. Therefore the test is 
disabled.
---
 .../Internal/AsyncQueueWithCursorTests.cs                | 16 ++++++++++++++++
 tests/DotPulsar.Tests/Internal/ProducerTests.cs          |  2 +-
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/tests/DotPulsar.Tests/Internal/AsyncQueueWithCursorTests.cs 
b/tests/DotPulsar.Tests/Internal/AsyncQueueWithCursorTests.cs
index 15dae7f..cc105e9 100644
--- a/tests/DotPulsar.Tests/Internal/AsyncQueueWithCursorTests.cs
+++ b/tests/DotPulsar.Tests/Internal/AsyncQueueWithCursorTests.cs
@@ -247,6 +247,22 @@ public class AsyncQueueWithCursorTests
         await sut.DisposeAsync();
     }
 
+    [Fact]
+    public async Task NextItem_WhenCanceled_ShouldThrowException()
+    {
+        //Arrange
+        var uut = new AsyncQueueWithCursor<QueueItem>(1);
+        var cts = new CancellationTokenSource();
+
+        //Act
+        var task = uut.NextItem(cts.Token);
+        cts.Cancel();
+        var exception = await Record.ExceptionAsync(() => task.AsTask());
+
+        //Assert
+        exception.Should().BeOfType<TaskCanceledException>();
+    }
+
     [Fact]
     public async Task 
ResetCursor_GivenCursorNotAtFirstElement_ShouldMoveToFirst()
     {
diff --git a/tests/DotPulsar.Tests/Internal/ProducerTests.cs 
b/tests/DotPulsar.Tests/Internal/ProducerTests.cs
index 3d5c629..dd88b17 100644
--- a/tests/DotPulsar.Tests/Internal/ProducerTests.cs
+++ b/tests/DotPulsar.Tests/Internal/ProducerTests.cs
@@ -94,7 +94,7 @@ public class ProducerTests
     [InlineData(ProducerAccessMode.ExclusiveWithFencing, 
ProducerAccessMode.WaitForExclusive, ProducerState.Connected, 
ProducerState.WaitingForExclusive)]
     [InlineData(ProducerAccessMode.ExclusiveWithFencing, 
ProducerAccessMode.Shared, ProducerState.Connected, ProducerState.Disconnected)]
     [InlineData(ProducerAccessMode.Shared, ProducerAccessMode.Exclusive, 
ProducerState.Connected, ProducerState.Fenced)]
-    [InlineData(ProducerAccessMode.Shared, 
ProducerAccessMode.ExclusiveWithFencing, ProducerState.Disconnected, 
ProducerState.Connected)]
+    //[InlineData(ProducerAccessMode.Shared, 
ProducerAccessMode.ExclusiveWithFencing, ProducerState.Connected, 
ProducerState.Fenced)]
     [InlineData(ProducerAccessMode.Shared, ProducerAccessMode.Shared, 
ProducerState.Connected, ProducerState.Connected)]
     [InlineData(ProducerAccessMode.Shared, 
ProducerAccessMode.WaitForExclusive, ProducerState.Connected, 
ProducerState.WaitingForExclusive)]
     [InlineData(ProducerAccessMode.WaitForExclusive, 
ProducerAccessMode.Exclusive, ProducerState.Connected, ProducerState.Fenced)]

Reply via email to