title: How to close listening UDP sockets when mocha times-out?
body: <p>I have some tests which bind to a UDP port, e.g.</p>
  <pre><code>describe('the server', function() {
    it('should respond to a udp packet', function(done) {
      const udp = dgram.createSocket('udp4');
  
      udp.on('error', function(error) {
        console.log(error);
      });
  
      udp.on('message', function(msg, rinfo) {
        console.log('msg', msg);
        console.log('rinfo', rinfo);
        // TODO: check the reply
        udp.close();
        done();
      });
      udp.bind();
  
      // send a request
      const bytes = Buffer.from(&quot;421a0800117860bc457f0100001a0653455256455222054d54303031&quot;, 'hex');
      udp.send(bytes, SERVER_PORT, SERVER_ADDR)
    });
  });
  </code></pre>
  <p>When the test completes successfully, that code path can call <code>udp.close()</code> which lets mocha exit.</p>
  <p>When a test exceeds mocha's 2 second time-out, I see the error but mocha does not exit as the UDP port is still listening.</p>
  <p>Is there some form of callback/event that I can use to close a listening UDP socket when mocha's 2 second time-out fires?</p>