-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
def run_image_with_cmd(vm_name, arr_of_vm_args, image_name, cmd, timeout = 240)
log(cmd)
base_cmd = "#{vm_name} #{arr_of_vm_args.join(" ")} \"#{SRC}/target/#{image_name}.image\" #{as_relative_path(Pathname.new(cmd))}"
case identify_os
when "windows" then system(base_cmd)
else
log("spawning with timeout #{timeout.to_s} seconds: nice #{base_cmd}")
pid = spawn("nice #{base_cmd}", err: STDERR, out: STDOUT)
future {
sleep(timeout.seconds)
log("Killed command for exceeding allotted time: nice #{base_cmd}.")
Process.kill('KILL', pid)
}
Process.wait(pid)
end
end
Let's try spawn on Windows too, and just nice on non-Windows platforms.
Metadata
Metadata
Assignees
Labels
No labels