From 85665bbe67697b7ae0b4b4ca3d142a31c2985fa1 Mon Sep 17 00:00:00 2001 From: Bernard Normier Date: Fri, 15 Nov 2024 09:16:20 -0500 Subject: [PATCH] Improve Slic slow write test (#4110) --- .../Transports/Slic/SlicTransportTests.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/IceRpc.Tests/Transports/Slic/SlicTransportTests.cs b/tests/IceRpc.Tests/Transports/Slic/SlicTransportTests.cs index fc1f181e6..673f66301 100644 --- a/tests/IceRpc.Tests/Transports/Slic/SlicTransportTests.cs +++ b/tests/IceRpc.Tests/Transports/Slic/SlicTransportTests.cs @@ -588,8 +588,9 @@ public async Task Connection_with_idle_timeout_is_not_aborted_when_idle([Values] Assert.That(async () => await acceptStreamTask, Throws.InstanceOf()); } - /// Verifies that setting the idle timeout doesn't abort the connection when there is slow write activity - /// from client to server. + /// Verifies that setting the idle timeout doesn't abort the connection even when there is slow write + /// activity from client to server. This slow write-only activity could possibly prevent the sending of Ping frames + /// from the client to the server, or prevent the server from reading these Ping frames. [Test] [NonParallelizable] public async Task Connection_with_idle_timeout_and_slow_write_is_not_aborted([Values] bool serverIdleTimeout) @@ -626,7 +627,12 @@ public async Task Connection_with_idle_timeout_and_slow_write_is_not_aborted([Va // Assert Assert.That(acceptStreamTask.IsCompleted, Is.True); - Assert.That(nextAcceptStreamTask.IsCompleted, Is.False); + if (nextAcceptStreamTask.IsCompleted) + { + // Unexpected. See #4108. + Assert.DoesNotThrowAsync(async () => await nextAcceptStreamTask); + Assert.Fail("nextAcceptStreamTask should not be completed"); + } await sut.Client.CloseAsync(MultiplexedConnectionCloseError.NoError, default); Assert.That(async () => await nextAcceptStreamTask, Throws.InstanceOf()); }