'use strict';
require('../common');
const assert = require('assert');
const net = require('net');

const server1 = net.createServer(function(socket) {
});
const server2 = net.createServer(function(socket) {
});
server1.listen(0, function() {
  server2.on('error', function(error) {
    assert.strictEqual(true, error.message.includes('EADDRINUSE'));
    server1.close();
  });
  server2.listen(this.address().port);
});
