mirror of
https://github.com/electron/electron.git
synced 2026-01-08 15:13:52 -05:00
chore: cleanup tests creating crashpad handler in the test runner process (#40668)
* chore: cleanup tests creating crashpad handler in the test runner process * ci: logging * ci: enable logging * ci: more logging * ci: run all tests * ci: more logging * ci: increase timeout * Revert "ci: increase timeout" This reverts commit870f74455d. * Revert "ci: more logging" This reverts commit46837f8b3a. * Revert "ci: run all tests" This reverts commit6a7889ce67. * Revert "ci: more logging" This reverts commit351473ab43. * Revert "ci: enable logging" This reverts commit194109ed5a. * Revert "ci: logging" This reverts commit9a3396fc7a. * chore: disable flaky ia32 tests
This commit is contained in:
@@ -5,7 +5,6 @@ import * as Busboy from 'busboy';
|
||||
import * as path from 'node:path';
|
||||
import { ifdescribe, ifit, defer, startRemoteControlApp, repeatedly, listen } from './lib/spec-helpers';
|
||||
import { app } from 'electron/main';
|
||||
import { crashReporter } from 'electron/common';
|
||||
import { EventEmitter } from 'node:events';
|
||||
import * as fs from 'node:fs';
|
||||
import * as uuid from 'uuid';
|
||||
@@ -583,16 +582,20 @@ ifdescribe(!isLinuxOnArm && !process.mas && !process.env.DISABLE_CRASH_REPORTER_
|
||||
});
|
||||
|
||||
describe('start() option validation', () => {
|
||||
it('requires that the submitURL option be specified', () => {
|
||||
expect(() => {
|
||||
it('requires that the submitURL option be specified', async () => {
|
||||
const { remotely } = await startRemoteControlApp();
|
||||
await expect(remotely(() => {
|
||||
const { crashReporter } = require('electron');
|
||||
crashReporter.start({} as any);
|
||||
}).to.throw('submitURL must be specified when uploadToServer is true');
|
||||
})).to.be.rejectedWith('submitURL must be specified when uploadToServer is true');
|
||||
});
|
||||
|
||||
it('allows the submitURL option to be omitted when uploadToServer is false', () => {
|
||||
expect(() => {
|
||||
it('allows the submitURL option to be omitted when uploadToServer is false', async () => {
|
||||
const { remotely } = await startRemoteControlApp();
|
||||
await expect(remotely(() => {
|
||||
const { crashReporter } = require('electron');
|
||||
crashReporter.start({ uploadToServer: false } as any);
|
||||
}).not.to.throw();
|
||||
})).to.be.fulfilled();
|
||||
});
|
||||
|
||||
it('can be called twice', async () => {
|
||||
|
||||
@@ -10,6 +10,7 @@ import { setImmediate } from 'node:timers/promises';
|
||||
|
||||
const fixturesPath = path.resolve(__dirname, 'fixtures', 'api', 'utility-process');
|
||||
const isWindowsOnArm = process.platform === 'win32' && process.arch === 'arm64';
|
||||
const isWindows32Bit = process.platform === 'win32' && process.arch === 'ia32';
|
||||
|
||||
describe('utilityProcess module', () => {
|
||||
describe('UtilityProcess constructor', () => {
|
||||
@@ -58,14 +59,14 @@ describe('utilityProcess module', () => {
|
||||
expect(code).to.equal(0);
|
||||
});
|
||||
|
||||
it('emits \'exit\' when child process crashes', async () => {
|
||||
ifit(!isWindows32Bit)('emits \'exit\' when child process crashes', async () => {
|
||||
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 () => {
|
||||
ifit(!isWindows32Bit)('emits \'exit\' corresponding to the child process', async () => {
|
||||
const child1 = utilityProcess.fork(path.join(fixturesPath, 'endless.js'));
|
||||
await once(child1, 'spawn');
|
||||
const child2 = utilityProcess.fork(path.join(fixturesPath, 'crash.js'));
|
||||
@@ -95,7 +96,7 @@ describe('utilityProcess module', () => {
|
||||
});
|
||||
|
||||
describe('app \'child-process-gone\' event', () => {
|
||||
it('with default serviceName', async () => {
|
||||
ifit(!isWindows32Bit)('with default serviceName', async () => {
|
||||
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 +105,7 @@ describe('utilityProcess module', () => {
|
||||
expect(details.reason).to.be.oneOf(['crashed', 'abnormal-exit']);
|
||||
});
|
||||
|
||||
it('with custom serviceName', async () => {
|
||||
ifit(!isWindows32Bit)('with custom serviceName', async () => {
|
||||
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');
|
||||
|
||||
Reference in New Issue
Block a user