SIGN IN SIGN UP

transport: Fix data race on loopyWriter.estdStreams in AccountCheck tests (#9241)

#### Root Cause:
- When ping-pong loops finished, `testFlowControlAccountCheck` accessed
`st.loopy.estdStreams[id]` and `client.loopy.estdStreams[id]` directly.
- Because `loopyWriter.estdStreams` is private and unsynchronized
(`loopyWriter.run(`) assumes sole ownership), reading from this map
across goroutines raced with `cleanupStreamHandler` deleting streams
during timeouts or stream shutdown.
- Furthermore, when client stream goroutines encountered errors (e.g.
DeadlineExceeded) during ping-pongs, wg.Wait() returned while t.Errorf()
allowed the main test goroutine to continue inspecting broken streams.

#### Solution:
- Added `outStreamRequestForTesting` to `controlBuf`. This allows tests
to retrieve `*outStream` pointers safely from within `loopyWriter.run()`
without racing on `estdStreams`.
- Fail early on ping-pong goroutine failures.

RELEASE NOTES: none
E
Easwar Swaminathan committed
ff0b87f86bc6ce096b77cf6a1c3797c2e3ec7934
Parent: 4fdb83e
Committed by GitHub <noreply@github.com> on 7/30/2026, 6:07:07 AM