mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
test(agent): Fix TestAgent_UnixRemoteForwarding timeout (#7235)
This commit is contained in:
+4
-1
@@ -733,12 +733,15 @@ func TestAgent_UnixRemoteForwarding(t *testing.T) {
|
||||
|
||||
// It's possible that the socket is created but the server is not ready to
|
||||
// accept connections yet. We need to retry until we can connect.
|
||||
//
|
||||
// Note that we wait long here because if the tailnet connection has trouble
|
||||
// connecting, it could take 5 seconds or more to reconnect.
|
||||
var conn net.Conn
|
||||
require.Eventually(t, func() bool {
|
||||
var err error
|
||||
conn, err = net.Dial("unix", remoteSocketPath)
|
||||
return err == nil
|
||||
}, testutil.WaitShort, testutil.IntervalFast)
|
||||
}, testutil.WaitLong, testutil.IntervalFast)
|
||||
defer conn.Close()
|
||||
_, err = conn.Write([]byte("test"))
|
||||
require.NoError(t, err)
|
||||
|
||||
Reference in New Issue
Block a user