@@ -115,9 +115,6 @@ func (s *Server) SetTick(tick time.Duration) {
// Stop stops the server elegently.
func (s *Server) Stop() {
- if s.mode.Get() == stopMode {
- return
- }
s.mu.Lock()
s.stopped = true
switch s.mode.Get() {
@@ -190,7 +190,7 @@ func buildServer(t *testing.T, c *config.Config, id int64) (e *Server, h *httpte
break
}
if err != nil {
- destroyServer(t, e, h)
+ h.Close()
return nil, nil, err
time.Sleep(10 * time.Millisecond)