Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit04e404e

Browse files
authored
chore: dial the remote socket continually until connect (#6891)
It's possible that the command starts but the socket isn't readyeven when the file exists.
1 parent5686fc9 commit04e404e

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

‎agent/agent_test.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -673,13 +673,14 @@ func TestAgent_UnixRemoteForwarding(t *testing.T) {
673673
err=cmd.Start()
674674
require.NoError(t,err)
675675

676+
// It's possible that the socket is created but the server is not ready to
677+
// accept connections yet. We need to retry until we can connect.
678+
varconn net.Conn
676679
require.Eventually(t,func()bool {
677-
_,err:=os.Stat(remoteSocketPath)
680+
varerrerror
681+
conn,err=net.Dial("unix",remoteSocketPath)
678682
returnerr==nil
679-
},testutil.WaitLong,testutil.IntervalFast)
680-
681-
conn,err:=net.Dial("unix",remoteSocketPath)
682-
require.NoError(t,err)
683+
},testutil.WaitShort,testutil.IntervalFast)
683684
deferconn.Close()
684685
_,err=conn.Write([]byte("test"))
685686
require.NoError(t,err)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp