Skip to content

Commit

Permalink
fix: utilise socket helper funcs in getAddress (#7058)
Browse files Browse the repository at this point in the history
(cherry picked from commit d7225b2)
  • Loading branch information
pkoutsovasilis authored and mergify[bot] committed Mar 4, 2025
1 parent 6d13c12 commit 32d3832
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/component/runtime/conn_info_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/elastic/elastic-agent-client/v7/pkg/proto"
"github.com/elastic/elastic-agent/internal/pkg/testutils"
"github.com/elastic/elastic-agent/pkg/ipc"
"github.com/elastic/elastic-agent/pkg/utils"
)

type mockCommunicator struct {
Expand Down Expand Up @@ -81,11 +82,11 @@ func getAddress(dir string, isLocal bool) string {

if runtime.GOOS == "windows" {
u.Scheme = "npipe"
return u.JoinPath("/", testSock).String()
return utils.SocketURLWithFallback(testSock, "/")
}

u.Scheme = "unix"
return u.JoinPath(dir, testSock).String()
return utils.SocketURLWithFallback(testSock, dir)
}
return fmt.Sprintf("127.0.0.1:%d", testPort)
}
Expand Down

0 comments on commit 32d3832

Please sign in to comment.