playwright/tests/playwright-test/assets/simple-server-ignores-sigterm.js
Andrey Lushnikov c63a0b536d
feat: send SIGTERM to webserver before SIGKILL'ing it. (#18220)
We now will send `SIGTERM` to the webserver and wait for the `timeout`
before sending `SIGKILL` to it.

Fixes #18209
2022-10-21 08:55:06 -07:00

14 lines
371 B
JavaScript

const http = require('http');
const port = process.argv[2] || 3000;
const server = http.createServer(function (req, res) {
res.end('running!');
});
process.on('SIGTERM', () => console.log('received SIGTERM - ignoring'));
process.on('SIGINT', () => console.log('received SIGINT - ignoring'));
server.listen(port, () => {
console.log('listening on port', port);
});