Skip to content

Commit b395b67

Browse files
feat/1421 updated tests to fix flakyness - removed delay before assertion that is causing upstream connection from proxy to teardown prematurely before test ends
1 parent 33f097c commit b395b67

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/WireMock.Net.Tests/WebSockets/WebSocketIntegrationTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -813,9 +813,9 @@ public async Task WithWebSocketProxy_Should_Proxy_Binary_Messages()
813813

814814
var receivedData = await client.ReceiveAsBytesAsync(cancellationToken: _ct);
815815

816-
await Task.Delay(500, _ct);
817-
818-
// Assert
816+
// Assert immediately — receivedData is already in memory, no delay needed.
817+
// Delaying here gives the proxy time to tear down its upstream connection, which
818+
// causes the close handshake below to fail intermittently.
819819
receivedData.Should().BeEquivalentTo(testData, "binary data should be proxied and echoed back");
820820

821821
await client.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct);

0 commit comments

Comments
 (0)