test: print stdout/stderr in signals.spec (#18456)
This commit is contained in:
parent
9ad18b9e57
commit
e725293586
|
|
@ -23,10 +23,19 @@ test.slow();
|
||||||
|
|
||||||
test('should close the browser when the node process closes', async ({ startRemoteServer, isWindows, server }) => {
|
test('should close the browser when the node process closes', async ({ startRemoteServer, isWindows, server }) => {
|
||||||
const remoteServer = await startRemoteServer({ url: server.EMPTY_PAGE });
|
const remoteServer = await startRemoteServer({ url: server.EMPTY_PAGE });
|
||||||
if (isWindows)
|
try {
|
||||||
execSync(`taskkill /pid ${remoteServer.child().pid} /T /F`, { stdio: 'ignore' });
|
if (isWindows)
|
||||||
else
|
execSync(`taskkill /pid ${remoteServer.child().pid} /T /F`, { stdio: 'ignore' });
|
||||||
process.kill(remoteServer.child().pid);
|
else
|
||||||
|
process.kill(remoteServer.child().pid);
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
if (error.stdout)
|
||||||
|
console.log('--- stdout ---\n', error.stdout);
|
||||||
|
if (error.stderr)
|
||||||
|
console.log('--- stderr ---\n', error.stderr);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
// We might not get browser exitCode in time when killing the parent node process,
|
// We might not get browser exitCode in time when killing the parent node process,
|
||||||
// so we don't check it here.
|
// so we don't check it here.
|
||||||
expect(await remoteServer.childExitCode()).toBe(isWindows ? 1 : 0);
|
expect(await remoteServer.childExitCode()).toBe(isWindows ? 1 : 0);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue