mirror of
https://github.com/nodejs/node.git
synced 2025-05-06 11:29:26 +00:00

The timer is not necessary. The test will timeout via the test harness if the test fails. This should resolve spurious CI failures. PR-URL: https://github.com/nodejs/node/pull/9361 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
25 lines
561 B
JavaScript
25 lines
561 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const dgram = require('dgram');
|
|
|
|
if (common.isOSX) {
|
|
common.skip('because of 17894467 Apple bug');
|
|
return;
|
|
}
|
|
|
|
const client = dgram.createSocket('udp4');
|
|
|
|
client.on('message', common.mustCall(function onMessage(buf, info) {
|
|
const expected = Buffer.alloc(0);
|
|
assert.ok(buf.equals(expected), 'message was received correctly');
|
|
client.close();
|
|
}));
|
|
|
|
client.on('listening', function() {
|
|
client.send([], this.address().port, common.localhostIPv4);
|
|
});
|
|
|
|
client.bind(0);
|