Fix several Connect test's dependence on ReceiveAsync returning complete message
authorStephen Toub <stoub@microsoft.com>
Wed, 27 Sep 2017 20:12:55 +0000 (16:12 -0400)
committerStephen Toub <stoub@microsoft.com>
Fri, 29 Sep 2017 01:08:26 +0000 (21:08 -0400)
commit6ca3d41d4970770aaca447e78d7149f571cf281a
treef3344450cb6d1e74513c6fe40a99d76565e06518
parent87355a5c917c4d01d442c38fa6b1aa24fb67b480
Fix several Connect test's dependence on ReceiveAsync returning complete message

There's no guarantee that WebSocket.ReceiveAsync will return a complete message; in the extreme, a message can contain long.MaxValue bytes but the API only allows you to retrieve ~int.MaxValue at a time, but even way below that, it's common for ReceiveAsync to return the data it has available rather than gathering up all of the data from the message.  However, several of the ConnectTest tests were depending on the full-message behavior.  This commit fixes that.

Commit migrated from https://github.com/dotnet/corefx/commit/ffaf5375c00622b285997bc9626c042b9d64195c
src/libraries/System.Net.WebSockets.Client/tests/ClientWebSocketTestBase.cs
src/libraries/System.Net.WebSockets.Client/tests/ConnectTest.cs