Skip to content

Commit

Permalink
fix server on shutdown (istio#2768)
Browse files Browse the repository at this point in the history
test/client/... fails on racetest, and noticed this is the reason
why.

As is written https://golang.org/pkg/net/http/#ListenAndServe,
this kind of method would always return non-nil error, which
always falls into log.Fatal.
  • Loading branch information
jmuk authored Jan 24, 2018
1 parent 8240eba commit 36cf45e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions mixer/test/client/env/http_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,7 @@ func (s *HTTPServer) Start() {
go func() {
http.HandleFunc("/", handler)
http.HandleFunc("/pubkey", pubkeyHandler)
err := http.Serve(s.lis, nil)
if err != nil {
log.Fatal(err)
}
_ = http.Serve(s.lis, nil)
}()

url := fmt.Sprintf("http://localhost:%v/echo", s.port)
Expand Down

0 comments on commit 36cf45e

Please sign in to comment.