Updated based on @tylertreat feedback.

This commit is contained in:
Peter Miron
2017-06-12 10:48:30 -04:00
parent 5e640f099d
commit 606502091c
3 changed files with 6 additions and 5 deletions

View File

@@ -4,6 +4,7 @@ package server
import (
"fmt"
"net"
"os"
"path/filepath"
"reflect"
@@ -11,7 +12,6 @@ import (
"time"
"github.com/nats-io/go-nats"
"net"
)
// Ensure Reload returns an error when attempting to reload a server that did

View File

@@ -502,8 +502,7 @@ func TestClientConnectToRoutePort(t *testing.T) {
opts.Cluster.Host = "localhost"
opts.Cluster.NoAdvertise = true
s := RunServer(opts)
s.Noticef("%+v\n", opts)
// defer s.Shutdown()
defer s.Shutdown()
url := fmt.Sprintf("nats://%s:%d", opts.Cluster.Host, s.ClusterAddr().(*net.TCPAddr).Port)
clientURL := fmt.Sprintf("nats://%s:%d", opts.Host, opts.Port)
@@ -516,7 +515,6 @@ func TestClientConnectToRoutePort(t *testing.T) {
// attempts rather small.
total := 10
for i := 0; i < total; i++ {
s.Noticef("URL: %s", url)
nc, err := nats.Connect(url)
if err != nil {
t.Fatalf("Unexepected error on connect: %v", err)

View File

@@ -477,7 +477,10 @@ func (s *Server) StartProfiler() {
go func() {
// if this errors out, it's probably because the server is being shutdown
srv.Serve(l)
err := srv.Serve(l)
if err != nil {
s.Fatalf("error starting profiler: %s", err)
}
s.done <- true
}()
}