mirror of
https://github.com/bellingcat/ukraine-timemap.git
synced 2026-06-08 03:18:36 +03:00
Fix travis subprocess.kill problem - attempt 3
- Don't connect to pipes of spawned yawn process (we don't need them, and they can prevent us from exiting the mocha process) - agent: false to avoid keeping http connection alive even after get is finished (also keeping mocha process alive)
This commit is contained in:
@@ -14,24 +14,22 @@ describe('server process', function() {
|
||||
console.log("launching server...")
|
||||
server_proc = child_process.spawn('yarn', ['dev'], {
|
||||
cwd: '.',
|
||||
shell: '/bin/bash',
|
||||
detached: true
|
||||
stdio: 'ignore'
|
||||
});
|
||||
|
||||
server_proc.on('exit', function(code, signal) {
|
||||
server_exited = true;
|
||||
});
|
||||
|
||||
return (new Promise(function(done) {
|
||||
return (new Promise(function(resolve) {
|
||||
// @TODO Better way to detect server alive-ness than waiting?
|
||||
setTimeout(done, SERVER_LAUNCH_WAIT_TIME)
|
||||
setTimeout(resolve, SERVER_LAUNCH_WAIT_TIME)
|
||||
}));
|
||||
});
|
||||
|
||||
after(function() {
|
||||
console.log("killing server...")
|
||||
server_proc.unref();
|
||||
server_proc.kill();
|
||||
server_proc.kill('SIGKILL');
|
||||
});
|
||||
|
||||
it('should launch', function() {
|
||||
@@ -51,7 +49,8 @@ describe('server process', function() {
|
||||
http.get({
|
||||
hostname: 'localhost',
|
||||
port: 8080,
|
||||
path: '/'
|
||||
path: '/',
|
||||
agent: false
|
||||
}, function(res) {
|
||||
var result_data = '';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user