From eb427b599e649fa36f054b355264ed89389cd63c Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Sat, 31 May 2025 16:21:17 +0800 Subject: [PATCH] http3: fix flaky TestConnControlStreamFailure (#5188) --- http3/conn_test.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/http3/conn_test.go b/http3/conn_test.go index 34f9fdf8a..1d71e3db2 100644 --- a/http3/conn_test.go +++ b/http3/conn_test.go @@ -207,6 +207,12 @@ func testConnControlStreamFailures(t *testing.T, data []byte, readErr error, exp _, err = controlStr.Write(quicvarint.Append(nil, streamTypeControlStream)) require.NoError(t, err) + done := make(chan struct{}) + go func() { + defer close(done) + conn.handleUnidirectionalStreams(nil) + }() + switch readErr { case nil: _, err = controlStr.Write(data) @@ -223,11 +229,6 @@ func testConnControlStreamFailures(t *testing.T, data []byte, readErr error, exp conn.openRequestStream(context.Background(), nil, nil, true, 1000) - done := make(chan struct{}) - go func() { - defer close(done) - conn.handleUnidirectionalStreams(nil) - }() select { case <-serverConn.Context().Done(): require.ErrorIs(t,