Test logging
This commit is contained in:
parent
2d2cc63840
commit
cb7233ee5b
|
|
@ -57,6 +57,7 @@ export function runDriver() {
|
|||
// We still will destruct everything (close browsers and exit) when the transport pipe closes.
|
||||
process.on('SIGINT', () => {
|
||||
// Keep the process running.
|
||||
console.log('SIGINT received');
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -527,6 +527,7 @@ async function launchContext(options: Options, extraOptions: LaunchOptions): Pro
|
|||
});
|
||||
});
|
||||
process.on('SIGINT', async () => {
|
||||
console.log('SIGINT received, closing browser...');
|
||||
await closeBrowser();
|
||||
gracefullyProcessExitDoNotHang(130);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -51,8 +51,12 @@ let forceExitInitiated = false;
|
|||
sendMessageToParent({ method: 'ready' });
|
||||
|
||||
process.on('disconnect', () => gracefullyCloseAndExit(true));
|
||||
process.on('SIGINT', () => {});
|
||||
process.on('SIGTERM', () => {});
|
||||
process.on('SIGINT', () => {
|
||||
console.log('SIGINT received');
|
||||
});
|
||||
process.on('SIGTERM', () => {
|
||||
console.log('SIGTERM received');
|
||||
});
|
||||
|
||||
// Clear execArgv immediately, so that the user-code does not inherit our loader.
|
||||
process.execArgv = execArgvWithoutExperimentalLoaderOptions();
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ class FixedNodeSIGINTHandler {
|
|||
private static _handlerInstalled = false;
|
||||
|
||||
static _dispatch = () => {
|
||||
console.log('SIGINT received');
|
||||
if (this._ignoreNextSIGINTs)
|
||||
return;
|
||||
|
||||
|
|
|
|||
|
|
@ -458,6 +458,9 @@ await page1.GotoAsync("about:blank?foo");`);
|
|||
const harFileName = testInfo.outputPath('har.har');
|
||||
const cli = runCLI([`--save-storage=${storageFileName}`, `--save-har=${harFileName}`]);
|
||||
await cli.waitFor(`import { test, expect } from '@playwright/test'`);
|
||||
cli.process.process.on('SIGINT', () => {
|
||||
console.log('Local SIGINT');
|
||||
});
|
||||
await cli.process.kill('SIGINT');
|
||||
const { exitCode, signal } = await cli.process.exited;
|
||||
if (exitCode !== null) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue