This commit is contained in:
deepak1556 2023-12-05 22:55:28 +09:00
Родитель 46837f8b3a
Коммит 870f74455d
1 изменённых файлов: 8 добавлений и 4 удалений

Просмотреть файл

@ -58,14 +58,16 @@ describe('utilityProcess module', () => {
expect(code).to.equal(0);
});
it('emits \'exit\' when child process crashes', async () => {
it('emits \'exit\' when child process crashes', async function () {
this.timeout(180000);
const child = utilityProcess.fork(path.join(fixturesPath, 'crash.js'));
// Do not check for exit code in this case,
// SIGSEGV code can be 139 or 11 across our different CI pipeline.
await once(child, 'exit');
});
it('emits \'exit\' corresponding to the child process', async () => {
it('emits \'exit\' corresponding to the child process', async function () {
this.timeout(180000);
const child1 = utilityProcess.fork(path.join(fixturesPath, 'endless.js'));
await once(child1, 'spawn');
const child2 = utilityProcess.fork(path.join(fixturesPath, 'crash.js'));
@ -95,7 +97,8 @@ describe('utilityProcess module', () => {
});
describe('app \'child-process-gone\' event', () => {
it('with default serviceName', async () => {
it('with default serviceName', async function () {
this.timeout(180000);
utilityProcess.fork(path.join(fixturesPath, 'crash.js'));
const [, details] = await once(app, 'child-process-gone') as [any, Electron.Details];
expect(details.type).to.equal('Utility');
@ -104,7 +107,8 @@ describe('utilityProcess module', () => {
expect(details.reason).to.be.oneOf(['crashed', 'abnormal-exit']);
});
it('with custom serviceName', async () => {
it('with custom serviceName', async function () {
this.timeout(180000);
utilityProcess.fork(path.join(fixturesPath, 'crash.js'), [], { serviceName: 'Hello World!' });
const [, details] = await once(app, 'child-process-gone') as [any, Electron.Details];
expect(details.type).to.equal('Utility');