describe('gae_flex_postgres_connect', () => { it('should be listening', async () => { const child = childProcess.exec(`node ${appPath}`); const isOpen = await waitPort({port: PORT}); expect(isOpen).to.be.true; process.kill(child.pid, 'SIGTERM'); }); });
function start(sqlConfig) { //handle cmd line arguments cmdargs.handle(sqlConfig); if (cluster.isMaster && sqlConfig.useCpuCores > 1) { console.log(`Master ${process.pid} is running`); for (let i = 0; i < numCPUs && i < sqlConfig.useCpuCores; i++) { console.log(`Forking process number ${i}...`); cluster.fork(); } cluster.on("exit", function(worker, code, signal) { console.log( "Worker " + worker.process.pid + " died with code: " + code + ", and signal: " + signal ); console.log("Starting a new worker"); cluster.fork(); }); } else { startXmysql(sqlConfig); } }
}); const result = await Promise.race([finishPromise, this._disconnectPromise]); if (result === DebugState.PROCESS_DISCONNECT && !this._connected.has(p.pid)) {
it('should notify process about error', function(done) { var app = forkNotify(); app.once('message', function(data) { data.type.should.eql('process:exception'); data.data.message.should.eql('hey'); process.kill(app.pid); done(); }); });
cluster.on('exit', function (worker, code, signal) { console.log('Worker ' + worker.process.pid + ' died with code: ' + code + ', and signal: ' + signal); console.log('Starting a new worker'); worker = cluster.fork(); workerList.push(worker); });
setTimeout(async () => { let err; try { await run(); } catch (e) { err = e; } process.kill(-offlineChild.pid, 'SIGINT'); if (err) { throw err; } }, process.env.OFFLINE_STARTUP_MILLIS || 5000);
cluster.on('exit', (worker, code, signal) => { logger.warn('worker %s died (code = %s; signal = %s). restart...', worker.process.pid, code, signal); clearInterval(idCheckInterval); endCheckHealth(); canStartCheck = true; cluster.fork(); });
cluster.on('exit', (worker, code, signal) => { console.info(`${new Date()}: Node ${worker.process.pid} died with code: ${code}, and signal:`, signal); console.info(`${new Date()}: Starting a new node...`); cluster.fork(); });
/** * Worker Event Handlers **/ cluster.on("exit", function (worker, code, signal) { say("Worker with PID: " + worker.process.pid + ", died with code =>" + code + ", signal => " + signal + " Restarting..."); cluster.fork(); });
cluster.on('exit', function (worker, code, signal) { console.log('Worker ' + worker.process.pid + ' died with code: ' + code + ', and signal: ' + signal); console.log('Starting a new worker'); worker = cluster.fork(); worker.on('message', messageHandler); workerList.push(worker); });
describe('server listening', () => { it('should be listening', async () => { const child = childProcess.exec(`node ${appPath}`); const isOpen = await waitPort({port: PORT}); expect(isOpen).to.be.true; process.kill(child.pid, 'SIGTERM'); }); });
cluster.on('exit', function (worker, code, signal) { console.log('Worker ' + worker.process.pid + ' died with code: ' + code + ', and signal: ' + signal); console.log('Starting a new worker'); worker = cluster.fork(); worker.on('message', messageHandler); workerList.push(worker); });