From 608a96f70e3d59584a6cd18f6fbd0de3fbc74a48 Mon Sep 17 00:00:00 2001
From: Geoffrey Kizer <geoffrek@windows.microsoft.com>
Date: Sat, 17 Apr 2021 18:36:57 -0700
Subject: [PATCH] revert test change

---
 .../tests/System/Net/Http/Http2LoopbackConnection.cs       | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/src/libraries/Common/tests/System/Net/Http/Http2LoopbackConnection.cs b/src/libraries/Common/tests/System/Net/Http/Http2LoopbackConnection.cs
index dbe33fabff9e8..2601b2839bb60 100644
--- a/src/libraries/Common/tests/System/Net/Http/Http2LoopbackConnection.cs
+++ b/src/libraries/Common/tests/System/Net/Http/Http2LoopbackConnection.cs
@@ -94,17 +94,12 @@ private async Task ReadPrefixAsync()
                 // Tests that use HttpAgnosticLoopbackServer will attempt to send an HTTP/1.1 request to an HTTP/2 server.
                 // This is invalid and we should terminate the connection.
                 // However, if we simply terminate the connection without sending anything, then this could be interpreted
-                // as a server failure that should be retried by SocketsHttpHandler.
+                // as a server disconnect that should be retried by SocketsHttpHandler.
                 // Since those tests are not set up to handle multiple retries, we instead just send back an invalid response here
                 // so that SocketsHttpHandler will not induce retry.
                 // The contents of what we send don't really matter, as long as it is interpreted by SocketsHttpHandler as an invalid response.
                 await _connectionStream.WriteAsync(Encoding.ASCII.GetBytes("HTTP/2.0 400 Bad Request\r\n\r\n"));
                 _connectionSocket.Shutdown(SocketShutdown.Send);
-
-                // Wait for client close to avoid RST which could lead to retry.
-                byte[] buffer = new byte[1024];
-                while ((await _connectionStream.ReadAsync(buffer)) != 0) { }
-                throw new Exception("HTTP 1.1 request received.");
             }
         }