add ErrTransportClosed and use it for Listen/Dial after transport close (#4883)

* add ErrTransportClosed and use it for Listen/Dial after transport close

* include the original error in the ErrTransportClosed error string
This commit is contained in:
Marten Seemann
2025-01-20 21:54:40 -08:00
committed by GitHub
parent 33fd4d1d16
commit 07bbe8c383
4 changed files with 150 additions and 8 deletions

View File

@@ -166,7 +166,9 @@ func TestTransportErrFromConn(t *testing.T) {
t.Fatal("timeout")
}
// TODO(#4778): test that it's not possible to listen after the transport is closed
_, err := tr.Listen(&tls.Config{}, nil)
require.Error(t, err)
require.ErrorIs(t, err, ErrTransportClosed)
}
func TestTransportStatelessResetReceiving(t *testing.T) {