diff --git a/internal/quic/conn_async_test.go b/internal/quic/conn_async_test.go index 0da3ddb452..5b419c4e54 100644 --- a/internal/quic/conn_async_test.go +++ b/internal/quic/conn_async_test.go @@ -101,7 +101,9 @@ func runAsync[T any](ts *testConn, f func(context.Context) (T, error)) *asyncOp[ as := &ts.asyncTestState if as.notify == nil { as.notify = make(chan struct{}) + as.mu.Lock() as.blocked = make(map[*blockedAsync]struct{}) + as.mu.Unlock() } _, file, line, _ := runtime.Caller(1) ctx := context.WithValue(context.Background(), asyncContextKey{}, true)