Skip to content

Commit

Permalink
martian(h2): use localhost for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
mmatczuk committed Feb 22, 2024
1 parent 47542fe commit 56fd6d7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/martian/h2/testing/fixture.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func New(spf []h2.StreamProcessorFactory) (*Fixture, error) {
f.server = grpc.NewServer(grpc.Creds(credentials.NewServerTLSFromCert(Localhost)))
tspb.RegisterTestServiceServer(f.server, &Server{})

lis, err := net.Listen("tcp", ":0")
lis, err := net.Listen("tcp", "localhost:0")
if err != nil {
return nil, fmt.Errorf("creating listener for gRPC service: %w", err)
}
Expand All @@ -90,7 +90,7 @@ func New(spf []h2.StreamProcessorFactory) (*Fixture, error) {
proxyPort = queryPortServer()
if proxyPort == 0 {
var err error
f.proxyListener, err = net.Listen("tcp", ":0")
f.proxyListener, err = net.Listen("tcp", "localhost:0")
if err != nil {
return nil, fmt.Errorf("creating listener for proxy; %w", err)
}
Expand All @@ -103,7 +103,7 @@ func New(spf []h2.StreamProcessorFactory) (*Fixture, error) {
}
if f.proxyListener == nil {
var err error
f.proxyListener, err = net.Listen("tcp", fmt.Sprintf(":%d", proxyPort))
f.proxyListener, err = net.Listen("tcp", fmt.Sprintf("localhost:%d", proxyPort))
if err != nil {
return nil, fmt.Errorf("creating listener for proxy; %w", err)
}
Expand Down

0 comments on commit 56fd6d7

Please sign in to comment.