Skip to content

Commit c0a42bc

Browse files
santigimenoMyles Borins
authored andcommitted
test: verify IPC messages are emitted on next tick
The test in this commit runs correctly if IPC messages are properly consumed and emitted. Otherwise, the test times out. Fixes: #6561 PR-URL: #6909 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 0b8124f commit c0a42bc

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
'use strict';
2+
constcommon=require('../common');
3+
consthttp=require('http');
4+
constcluster=require('cluster');
5+
6+
cluster.schedulingPolicy=cluster.SCHED_RR;
7+
8+
constserver=http.createServer();
9+
10+
if(cluster.isMaster){
11+
server.listen(common.PORT);
12+
constworker=cluster.fork();
13+
worker.on('exit',common.mustCall(()=>{
14+
server.close();
15+
}));
16+
}else{
17+
process.on('uncaughtException',common.mustCall((e)=>{}));
18+
server.listen(common.PORT);
19+
server.on('error',common.mustCall((e)=>{
20+
cluster.worker.disconnect();
21+
throwe;
22+
}));
23+
}

0 commit comments

Comments
(0)