From 0b8704f36a0c7d200d1d5e2ffb03877b23712413 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Papp?= Date: Wed, 1 Apr 2026 10:43:02 +0200 Subject: [PATCH] [client] Adjust connection tracking in reconnection test --- flow/client/client_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flow/client/client_test.go b/flow/client/client_test.go index 559d19950..300d19b05 100644 --- a/flow/client/client_test.go +++ b/flow/client/client_test.go @@ -466,15 +466,15 @@ func TestReceive_ProtocolErrorStreamReconnect(t *testing.T) { t.Fatal("timeout waiting for first ack") } + // Snapshot connection count before injecting the fault. + connsBefore := server.listener.connCount() + // Send a raw HTTP/2 RST_STREAM frame with PROTOCOL_ERROR on the TCP connection. // gRPC multiplexes streams on stream IDs 1, 3, 5, ... (odd, client-initiated). // Stream ID 1 is the client's first stream (our Events bidi stream). // This produces the exact error the client sees in production: // "stream terminated by RST_STREAM with error code: PROTOCOL_ERROR" server.listener.sendRSTStream(1) - - // Wait for the client to open a new TCP connection after the RST_STREAM. - connsBefore := server.listener.connCount() require.Eventually(t, func() bool { return server.listener.connCount() > connsBefore }, 5*time.Second, 50*time.Millisecond, "client did not open a new TCP connection after RST_STREAM")