Skip to content

Commit 443d046

Browse files
Trottrvagg
authored andcommitted
test: add common.platformTimeout() to dgram test
Use common.platformTimeout() to mitigate potential for CI to timeout on slower devices. Ref: #4937 PR-URL: #4938 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Myles Borins <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 90219c3 commit 443d046

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
'use strict';
2-
var common = require('../common');
3-
4-
var dgram = require('dgram');
5-
var client, timer, buf;
2+
const common = require('../common');
3+
const dgram = require('dgram');
64

75
if (process.platform === 'darwin') {
86
console.log('1..0 # Skipped: because of 17894467 Apple bug');
97
return;
108
}
119

12-
13-
client = dgram.createSocket('udp4');
10+
const client = dgram.createSocket('udp4');
1411

1512
client.bind(common.PORT);
1613

@@ -19,9 +16,9 @@ client.on('message', function(buffer, bytes) {
1916
client.close();
2017
});
2118

22-
buf = new Buffer(0);
19+
const buf = new Buffer(0);
2320
client.send(buf, 0, 0, common.PORT, '127.0.0.1', function(err, len) { });
2421

25-
timer = setTimeout(function() {
22+
const timer = setTimeout(function() {
2623
throw new Error('Timeout');
27-
}, 200);
24+
}, common.platformTimeout(200));

0 commit comments

Comments
 (0)