File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -673,13 +673,14 @@ func TestAgent_UnixRemoteForwarding(t *testing.T) {
673
673
err = cmd .Start ()
674
674
require .NoError (t , err )
675
675
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
+ var conn net.Conn
676
679
require .Eventually (t , func () bool {
677
- _ , err := os .Stat (remoteSocketPath )
680
+ var err error
681
+ conn , err = net .Dial ("unix" , remoteSocketPath )
678
682
return err == nil
679
- }, testutil .WaitLong , testutil .IntervalFast )
680
-
681
- conn , err := net .Dial ("unix" , remoteSocketPath )
682
- require .NoError (t , err )
683
+ }, testutil .WaitShort , testutil .IntervalFast )
683
684
defer conn .Close ()
684
685
_ , err = conn .Write ([]byte ("test" ))
685
686
require .NoError (t , err )
You can’t perform that action at this time.
0 commit comments