Bug 1373444 - Ignore exceptions during wpt test teardown, r=maja_zf

In general these exceptions are the result of something unexpected in
the environment, but shouldn't themseslves cause the test to error.

MozReview-Commit-ID: 5XjJoT4UwnC
This commit is contained in:
James Graham 2017-08-31 15:49:38 +01:00
parent 3c26537de4
commit 3426b3a38a

View File

@ -508,10 +508,14 @@ class MarionetteRefTestExecutor(RefTestExecutor):
self.implementation.setup(**self.implementation_kwargs)
def teardown(self):
self.implementation.teardown()
handle = self.protocol.marionette.window_handles[0]
self.protocol.marionette.switch_to_window(handle)
super(self.__class__, self).teardown()
try:
self.implementation.teardown()
handle = self.protocol.marionette.window_handles[0]
self.protocol.marionette.switch_to_window(handle)
super(self.__class__, self).teardown()
except Exception as e:
# Ignore errors during teardown
self.logger.warning(traceback.traceback.format_exc(e))
def is_alive(self):
return self.protocol.is_alive
@ -545,10 +549,10 @@ class MarionetteRefTestExecutor(RefTestExecutor):
test_url = self.test_url(test)
return ExecuteAsyncScriptRun(self.logger,
self._screenshot,
self.protocol,
test_url,
timeout).run()
self._screenshot,
self.protocol,
test_url,
timeout).run()
def _screenshot(self, marionette, url, timeout):
marionette.navigate(url)
@ -603,8 +607,10 @@ class InternalRefTestImplementation(object):
try:
self.executor.protocol.marionette._send_message("reftest:teardown", {})
self.executor.protocol.marionette.set_context(self.executor.protocol.marionette.CONTEXT_CONTENT)
except socket.error:
pass
except Exception as e:
# Ignore errors during teardown
self.logger.warning(traceback.traceback.format_exc(e))
class WdspecRun(object):
def __init__(self, func, session, path, timeout):