diff --git a/Makefile b/Makefile index e9cb930a825..0c28930d08a 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ PROJECT_ROOT=github.com/uber/jaeger -PACKAGES := $(shell glide novendor | grep -v ./thrift-gen/... | grep -v ./examples/...) +#PACKAGES := $(shell glide novendor | grep -v ./thrift-gen/... | grep -v ./examples/...) +PACKAGES := ./cmd/... # all .go files that don't exist in hidden directories ALL_SRC := $(shell find . -name "*.go" | grep -v -e vendor -e thrift-gen \ diff --git a/cmd/agent/app/agent_test.go b/cmd/agent/app/agent_test.go index 742222db0db..8b191ec2864 100644 --- a/cmd/agent/app/agent_test.go +++ b/cmd/agent/app/agent_test.go @@ -23,6 +23,7 @@ package app import ( "fmt" "io/ioutil" + "net" "net/http" "testing" "time" @@ -48,7 +49,7 @@ func TestAgentStartStop(t *testing.T) { Model: jaegerModel, Protocol: compactProtocol, Server: ServerConfiguration{ - HostPort: "127.0.0.1:0", + HostPort: "127.0.0.1:5776", }, }, }, @@ -88,6 +89,23 @@ func TestAgentStartStop(t *testing.T) { body, err := ioutil.ReadAll(resp.Body) assert.NoError(t, err) assert.Equal(t, "tcollector error: no peers available\n", string(body)) - assert.NoError(t, <-ch) + + for i := 0; i < 1000; i++ { + destAddr, err := net.ResolveUDPAddr("udp", "127.0.0.1:5776") + t.Log(destAddr.String()) + if err == nil { + _, err = net.DialUDP(destAddr.Network(), nil, destAddr) + if err == nil { + break + } else { + t.Log(err.Error()) + } + } else { + t.Log(err.Error()) + } + time.Sleep(time.Millisecond) + } + agent.Stop() + assert.NoError(t, <-ch) }