From 04bb1c2b13acefda9d71aab044708bb4cf18ea7d Mon Sep 17 00:00:00 2001 From: WendelHime <6754291+WendelHime@users.noreply.github.com> Date: Tue, 19 Nov 2024 16:54:02 -0300 Subject: [PATCH] fix: adding on success to dialer --- client/client_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/client/client_test.go b/client/client_test.go index bde5d8217..15d73ecba 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -72,13 +72,22 @@ func newTestUserConfig() *common.UserConfigData { } func resetDialers(client *Client, dial func(network, addr string) (net.Conn, error)) { + rdyC := make(chan struct{}, 1) d := dialer.New(&dialer.Options{ Dialers: []dialer.ProxyDialer{&testDialer{ name: "test-dialer", dial: dial, }}, + OnSuccess: func(dialer dialer.ProxyDialer) { + select { + case rdyC <- struct{}{}: + default: + } + }, }) client.dialer.set(d) + // Wait for the dialer to be ready + <-rdyC } func newClient() *Client {