Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix flaky test by removing timer #9199

Merged
merged 1 commit into from
Oct 25, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test: fix flaky test by removing timer
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 <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
evanlucas committed Oct 25, 2016
commit 2a654e47282c8b2847422f2d4c444180f214ab5c
9 changes: 2 additions & 7 deletions test/parallel/test-dgram-send-callback-buffer.js
Original file line number Diff line number Diff line change
@@ -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);