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
Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
'use strict';
2-
varcommon=require('../common');
3-
4-
vardgram=require('dgram');
5-
varclient,timer,buf;
2+
constcommon=require('../common');
3+
constdgram=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+
constclient=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=newBuffer(0);
19+
constbuf=newBuffer(0);
2320
client.send(buf,0,0,common.PORT,'127.0.0.1',function(err,len){});
2421

25-
timer=setTimeout(function(){
22+
consttimer=setTimeout(function(){
2623
thrownewError('Timeout');
27-
},200);
24+
},common.platformTimeout(200));

0 commit comments

Comments
(0)