From d79e0fc74c2e39d4efe0511d6286752dfcaea52b Mon Sep 17 00:00:00 2001 From: Ahmet Ibrahim Aksoy Date: Fri, 22 Mar 2024 08:57:48 +0100 Subject: [PATCH] Move 0 byte read before semaphore release --- .../tests/FunctionalTests/QuicStreamTests.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/libraries/System.Net.Quic/tests/FunctionalTests/QuicStreamTests.cs b/src/libraries/System.Net.Quic/tests/FunctionalTests/QuicStreamTests.cs index bdbf155d2d1ea..9a2e421e75dc0 100644 --- a/src/libraries/System.Net.Quic/tests/FunctionalTests/QuicStreamTests.cs +++ b/src/libraries/System.Net.Quic/tests/FunctionalTests/QuicStreamTests.cs @@ -1249,11 +1249,12 @@ await RunClientServer( { await stream.WritesClosed; } - serverSem.Release(); - await clientSem.WaitAsync(); var _ = await stream.ReadAsync(new byte[0]); + serverSem.Release(); + await clientSem.WaitAsync(); + if (closeServer) { expectedError = QuicError.OperationAborted; @@ -1281,11 +1282,12 @@ await RunClientServer( { await stream.WritesClosed; } - clientSem.Release(); - await serverSem.WaitAsync(); var _ = await stream.ReadAsync(new byte[0]); + clientSem.Release(); + await serverSem.WaitAsync(); + if (!closeServer) { expectedError = QuicError.OperationAborted;