fix: MessagePort closing unexpectedly with non-cloneable objects (#42535)
* fix: MessagePort closing unexpectedly with non-cloneable objects * fix: handle serialization failure in parentPort
This commit is contained in:
parent
6d2c72b14e
commit
8e8ea3ee8b
4 changed files with 34 additions and 3 deletions
|
@ -297,6 +297,17 @@ describe('utilityProcess module', () => {
|
|||
expect(child.kill()).to.be.true();
|
||||
await exit;
|
||||
});
|
||||
|
||||
it('handles the parent port trying to send an non-clonable object', async () => {
|
||||
const child = utilityProcess.fork(path.join(fixturesPath, 'non-cloneable.js'));
|
||||
await once(child, 'spawn');
|
||||
child.postMessage('non-cloneable');
|
||||
const [data] = await once(child, 'message');
|
||||
expect(data).to.equal('caught-non-cloneable');
|
||||
const exit = once(child, 'exit');
|
||||
expect(child.kill()).to.be.true();
|
||||
await exit;
|
||||
});
|
||||
});
|
||||
|
||||
describe('behavior', () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue