child_process: swallow errors in internal communication · nodejs/node@ea4be72
@@ -16,7 +16,7 @@ const key = 'test-key';
16161717const list = new SocketListSend(child, 'test');
181819-list._request('msg', 'cmd', common.mustCall((err) => {
19+list._request('msg', 'cmd', false, common.mustCall((err) => {
2020common.expectsError({
2121code: 'ERR_CHILD_CLOSED_BEFORE_REPLY',
2222type: Error,
@@ -30,7 +30,7 @@ const key = 'test-key';
3030{
3131const child = Object.assign(new EventEmitter(), {
3232connected: true,
33-send: function(msg) {
33+_send: function(msg) {
3434process.nextTick(() =>
3535this.emit('internalMessage', { key, cmd: 'cmd' })
3636);
@@ -39,7 +39,7 @@ const key = 'test-key';
39394040const list = new SocketListSend(child, key);
414142-list._request('msg', 'cmd', common.mustCall((err, msg) => {
42+list._request('msg', 'cmd', false, common.mustCall((err, msg) => {
4343assert.strictEqual(err, null);
4444assert.strictEqual(msg.cmd, 'cmd');
4545assert.strictEqual(msg.key, key);
@@ -53,12 +53,12 @@ const key = 'test-key';
5353{
5454const child = Object.assign(new EventEmitter(), {
5555connected: true,
56-send: function(msg) { process.nextTick(() => this.emit('disconnect')); }
56+_send: function(msg) { process.nextTick(() => this.emit('disconnect')); }
5757});
58585959const list = new SocketListSend(child, key);
606061-list._request('msg', 'cmd', common.mustCall((err) => {
61+list._request('msg', 'cmd', false, common.mustCall((err) => {
6262common.expectsError({
6363code: 'ERR_CHILD_CLOSED_BEFORE_REPLY',
6464type: Error,
@@ -73,7 +73,7 @@ const key = 'test-key';
7373{
7474const child = Object.assign(new EventEmitter(), {
7575connected: true,
76-send: function(msg) {
76+_send: function(msg) {
7777assert.strictEqual(msg.cmd, 'NODE_SOCKET_NOTIFY_CLOSE');
7878assert.strictEqual(msg.key, key);
7979process.nextTick(() =>
@@ -98,7 +98,7 @@ const key = 'test-key';
9898const count = 1;
9999const child = Object.assign(new EventEmitter(), {
100100connected: true,
101-send: function(msg) {
101+_send: function(msg) {
102102assert.strictEqual(msg.cmd, 'NODE_SOCKET_GET_COUNT');
103103assert.strictEqual(msg.key, key);
104104process.nextTick(() =>
@@ -127,7 +127,7 @@ const key = 'test-key';
127127const count = 1;
128128const child = Object.assign(new EventEmitter(), {
129129connected: true,
130-send: function() {
130+_send: function() {
131131process.nextTick(() => {
132132this.emit('disconnect');
133133this.emit('internalMessage', { key, count, cmd: 'NODE_SOCKET_COUNT' });