*Ensure static server is stopped on crashes or when puppeteer stops
This commit is contained in:
parent
aa66d23160
commit
ee4105f3a7
|
@ -139,6 +139,11 @@ export async function loadTester(page: Page, port = 8080) {
|
||||||
await new Promise((resolve) => {
|
await new Promise((resolve) => {
|
||||||
server.start(resolve);
|
server.start(resolve);
|
||||||
});
|
});
|
||||||
|
const stop = () => server.stop();
|
||||||
|
|
||||||
|
process.on("SIGTERM", stop);
|
||||||
|
page.browser().on("disconnected", stop);
|
||||||
|
|
||||||
await page.goto(`http://localhost:${port}/`);
|
await page.goto(`http://localhost:${port}/`);
|
||||||
await page.evaluate(() => {
|
await page.evaluate(() => {
|
||||||
return kernel.init();
|
return kernel.init();
|
||||||
|
|
Loading…
Reference in New Issue