diff --git a/test/parallel/test-dgram-send-callback-buffer.js b/test/parallel/test-dgram-send-callback-buffer.js index e2966645d927ae..e0b2a581bf74aa 100644 --- a/test/parallel/test-dgram-send-callback-buffer.js +++ b/test/parallel/test-dgram-send-callback-buffer.js @@ -9,14 +9,9 @@ const client = dgram.createSocket('udp4'); const buf = Buffer.allocUnsafe(256); const onMessage = common.mustCall(function(err, bytes) { - assert.strictEqual(err, null); - assert.equal(bytes, buf.length); - clearTimeout(timer); + assert.ifError(err); + assert.strictEqual(bytes, buf.length); client.close(); }); -const timer = setTimeout(function() { - throw new Error('Timeout'); -}, common.platformTimeout(200)); - client.send(buf, common.PORT, common.localhostIPv4, onMessage);