title: Connect reset by peer with Golang http server on Mac OS10.9.5
body: <p>I got an weird error when writing some stress tests on a golang web application.
  Here is the code for web server</p>
  
  <pre><code>package httptest
  
  import (
      "net/http"
      "testing"
  )
  
  func TestHttpTest(t *testing.T) {
      http.HandleFunc("/", func(res http.ResponseWriter, req *http.Request) {
          //&lt;-time.After(2 * time.Second)
      })
      http.ListenAndServe(":2222", nil)
  }
  </code></pre>
  
  <p>When I run go test ./... and use ApacheBench to perform stress test:</p>
  
  <pre><code>ab -c 200 -n 1000 http://localhost:2222/123
  </code></pre>
  
  <p>It gives me following error randomly:</p>
  
  <pre><code>Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
  Licensed to The Apache Software Foundation, http://www.apache.org/
  Benchmarking localhost (be patient)
  Completed 100 requests
  Completed 200 requests
  apr_socket_recv: Connection reset by peer (54)
  Total of 235 requests completed
  </code></pre>
  
  <p>I am running the test on Mac OS 10.9. The ulimit of the os is setting as unlimited. Does anyone meet the same problem?</p>