title: Random "write EPIPE" error
body: <p>I'm currently making a test program for a Node.js app that is going to send HTTP requests here and there.
  I'm using Chai to create my tests and Express to simulate the server.</p>
  
  <p>Here's my problem : When I run the following request, everything works fine ... but if I run it multiple times, I randomly get an error.
  It comes and go and doesn't seem to be linked to anything in my code, so I don't even know where to look at.</p>
  
  <p><strong>Here's my request :</strong></p>
  
  <pre><code>let chai = require('chai');
  let chaiHttp = require('chai-http');
  let fs = require('fs');
  
  let should = chai.should();
  
  chai.use(chaiHttp);
  
  describe("Test external service 'TEST'", function () {
      it('POST /testCheck', function testCheck(done) {
          chai.request('http://servicetest:8888')
              .post('/testCheck')
              .attach('files', "server.js")
              .end(function (err, res) {
                  if (err) {
                      console.log(err)
                      done();
                  } else {
                      res.should.have.status(202);
                      done();
                  }
              })
      })
  })
  </code></pre>
  
  <p><strong>When it works :</strong></p>
  
  <pre><code>Test external service 'TEST'
      ✓ POST /testCheck (51ms)
  
  1 passing (60ms)
  </code></pre>
  
  <p><strong>And randomly, I get this :</strong></p>
  
  <pre><code>Test external service 'TEST'
    1) POST /testCheck
  
  
  0 passing (50ms)
  1 failing
  
  1) Test external service 'TEST'
       POST /testCheck:
     Error: write EPIPE
      at _errnoException (util.js:1031:13)
      at WriteWrap.afterWrite [as oncomplete] (net.js:873:14)
  </code></pre>
  
  <p><strong>Here's the code on the other side :</strong></p>
  
  <pre><code>var express = require('express');
  var app = express();
  
  app.post('/testCheck', function(req, res) {
      if ((req.get('content-type') != undefined) &amp;&amp; (req.get('content-length') != undefined)) {
          res.status(202);
          res.end();
      } else {
          res.status(400);
          res.end();
      }
  });
  
  console.log("Server test started");
  app.listen(8888);
  </code></pre>
  
  <p>I absolutely don't understand what's going on and would like to sort this out before getting to anything else.</p>