Bug 1416747 - [marionette] Hardening test_cli_arguments.py TestCommandLineArguments.test_startup_timeout. r=ato

Using a startup timeout of 0s should always cause an IOError,
even for builds which startup within 100ms (pgo, Nightly opt).

Further the test should not modify the internal startup timeout
property, but pass the timeout as parameter to "start_session()".

Differential Revision: https://phabricator.services.mozilla.com/D10224

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Henrik Skupin 2018-10-30 21:47:29 +00:00
Родитель 249491eb67
Коммит 5fcc1832bd
1 изменённых файлов: 3 добавлений и 9 удалений

Просмотреть файл

@ -37,16 +37,10 @@ class TestCommandLineArguments(MarionetteTestCase):
self.assertTrue(safe_mode, "Safe Mode has not been enabled")
def test_startup_timeout(self):
startup_timeout = self.marionette.startup_timeout
# Use a timeout which always cause an IOError
self.marionette.startup_timeout = .1
msg = "Process killed after {}s".format(self.marionette.startup_timeout)
try:
self.marionette.quit()
with self.assertRaisesRegexp(IOError, msg):
self.marionette.start_session()
with self.assertRaisesRegexp(IOError, "Process killed after 0s"):
# Use a small enough timeout which should always cause an IOError
self.marionette.start_session(timeout=0)
finally:
self.marionette.startup_timeout = startup_timeout
self.marionette.start_session()