Skip to content

Commit

Permalink
test: fix flaky test by removing timer
Browse files Browse the repository at this point in the history
This fixes one of the tests that has been failing on CI on freebsd for
a bit by removing an unnecessary timer.

PR-URL: #9199
Fixes: #7929
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Santiago Gimeno <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
  • Loading branch information
evanlucas authored and MylesBorins committed Nov 19, 2016
1 parent e108f20 commit 0fdfba8
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions test/parallel/test-dgram-send-callback-buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

0 comments on commit 0fdfba8

Please sign in to comment.