When I execute a command in terminal it lasts ~5s, but when I use require('child_process').exec with a 1 minute timeout it returns [Error: Command failed: ] killed: true, code: null, signal: 'SIGTERM' after 1 minute?
P.S. that command generates some files and in both cases the output is ok.
Update: example of such behaviour:
var exec = require('child_process').exec
exec('docker run --rm -i ubuntu sleep 1',
{timeout:15000},
function(){
console.log(arguments)
}
)
If you remove the -i flag, it will work fine.
The -i "interactive" flag in Docker causes the STDIN to be opened and the exec won't like it by default.