2015-05-19 13:00:06 +02:00
|
|
|
'use strict';
|
2016-07-15 15:43:24 -04:00
|
|
|
const common = require('../common');
|
2016-12-30 18:38:06 -05:00
|
|
|
const net = require('net');
|
2017-01-08 13:19:00 +00:00
|
|
|
const server = net.createServer();
|
2015-01-02 23:14:25 -05:00
|
|
|
|
2019-03-22 03:44:26 +01:00
|
|
|
// Unref before listening
|
2015-01-02 23:14:25 -05:00
|
|
|
server.unref();
|
|
|
|
server.listen();
|
|
|
|
|
|
|
|
// If the timeout fires, that means the server held the event loop open
|
|
|
|
// and the unref() was not persistent. Close the server and fail the test.
|
2017-02-03 14:54:19 -05:00
|
|
|
setTimeout(common.mustNotCall(), 1000).unref();
|