Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #13400: Check the error code from a SIGKILL, and continue if the process has already ended. #15579

Closed
Closed
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -3,6 +3,7 @@
# You can obtain one at http://mozilla.org/MPL/2.0/.

import base64
import errno
import hashlib
import httplib
import json
@@ -53,6 +54,13 @@ def make_hosts_file():
f.write(hosts_text)
return hosts_path

def terminate_proc(proc):
try:
proc.kill()
except OSError as e:
# This means proc has already ended (No such proc)
if e.errno != errno.ESRCH:
raise e

class ServoTestharnessExecutor(ProcessTestExecutor):
convert_result = testharness_result_converter
@@ -140,9 +148,9 @@ def do_test(self, test):
self.logger.info("Pausing until the browser exits")
self.proc.wait()
else:
self.proc.kill()
terminate_proc(self.proc)
except KeyboardInterrupt:
self.proc.kill()
terminate_proc(self.proc)
raise

return result
@@ -249,19 +257,19 @@ def screenshot(self, test, viewport_size, dpi):
timeout = test.timeout * self.timeout_multiplier + 5
rv = self.proc.wait(timeout=timeout)
except KeyboardInterrupt:
self.proc.kill()
terminate_proc(self.proc)
raise
else:
self.proc = subprocess.Popen(self.command,
env=env)
try:
rv = self.proc.wait()
except KeyboardInterrupt:
self.proc.kill()
terminate_proc(self.proc)
raise

if rv is None:
self.proc.kill()
terminate_proc(self.proc)
return False, ("EXTERNAL-TIMEOUT", None)

if rv != 0 or not os.path.exists(output_path):
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.