tests: fix leak in TestDialParseTargetUnknownScheme (#2320)
Do a non-blocking send so if dial is called again in a retry, it won't block forever.
This commit is contained in:
Родитель
a338994886
Коммит
f8063d3b62
|
@ -97,8 +97,11 @@ func TestDialParseTargetUnknownScheme(t *testing.T) {
|
|||
{"passthrough://a.server.com/google.com", "google.com"},
|
||||
} {
|
||||
dialStrCh := make(chan string, 1)
|
||||
cc, err := Dial(test.targetStr, WithInsecure(), WithDialer(func(t string, _ time.Duration) (net.Conn, error) {
|
||||
dialStrCh <- t
|
||||
cc, err := Dial(test.targetStr, WithInsecure(), WithDialer(func(addr string, _ time.Duration) (net.Conn, error) {
|
||||
select {
|
||||
case dialStrCh <- addr:
|
||||
default:
|
||||
}
|
||||
return nil, fmt.Errorf("test dialer, always error")
|
||||
}))
|
||||
if err != nil {
|
||||
|
|
Загрузка…
Ссылка в новой задаче