Closed Bug 1006511 Opened 10 years ago Closed 10 years ago

Marionette timeouts shouldn't print the ScriptTimeoutException traceback to the log

Categories

(Remote Protocol :: Marionette, defect)

defect
Not set
normal

Tracking

(firefox30 wontfix, firefox31 wontfix, firefox32 fixed, b2g-v1.3 fixed, b2g-v1.3T fixed, b2g-v1.4 fixed, b2g-v2.0 fixed)

RESOLVED FIXED
mozilla32
Tracking Status
firefox30 --- wontfix
firefox31 --- wontfix
firefox32 --- fixed
b2g-v1.3 --- fixed
b2g-v1.3T --- fixed
b2g-v1.4 --- fixed
b2g-v2.0 --- fixed

People

(Reporter: emorley, Assigned: automatedtester)

References

(Blocks 1 open bug)

Details

(Keywords: pi-marionette-runner, sheriffing-P1)

Attachments

(2 files)

eg:
https://tbpl.mozilla.org/php/getParsedLog.php?id=39122484&tree=Mozilla-Inbound
{
04:16:29     INFO -  ======================================================================
04:16:29     INFO -  ERROR: None
04:16:29     INFO -  ----------------------------------------------------------------------
04:16:29     INFO -  Traceback (most recent call last):
04:16:29     INFO -    File "/builds/slave/test/build/tests/marionette/marionette/marionette_test.py", line 170, in run
04:16:29     INFO -      testMethod()
04:16:29     INFO -    File "/builds/slave/test/build/tests/marionette/marionette/marionette_test.py", line 497, in runTest
04:16:29     INFO -      filename=os.path.basename(self.jsFile))
04:16:29     INFO -    File "/builds/slave/test/build/tests/marionette/marionette/marionette.py", line 1057, in execute_js_script
04:16:29     INFO -      line=None)
04:16:29     INFO -    File "/builds/slave/test/build/tests/marionette/marionette/decorators.py", line 35, in _
04:16:29     INFO -      return func(*args, **kwargs)
04:16:29     INFO -    File "/builds/slave/test/build/tests/marionette/marionette/marionette.py", line 631, in _send_message
04:16:29     INFO -      self._handle_error(response)
04:16:29     INFO -    File "/builds/slave/test/build/tests/marionette/marionette/marionette.py", line 690, in _handle_error
04:16:29    ERROR -      raise ScriptTimeoutException(message=message, status=status, stacktrace=stacktrace)
04:16:29    ERROR -  TEST-UNEXPECTED-FAIL | test_emergency_label.js | ScriptTimeoutException: ScriptTimeoutException: timed out
04:16:29     INFO -  ----------------------------------------------------------------------
04:16:29     INFO -  Ran 1 test in 61.776s
04:16:29  WARNING -  FAILED (errors=1)
}

The ScriptTimeoutException is just a Pythonic way to handle the timeout internally - we shouldn't print the traceback to the log, since it's going to confuse parsers.

We're handling the exception by printing the timeout line, and so the traceback is both unnecessarily worrying to the lay-person reading the logs - and doesn't really add any content.
Excellent, Dave and I were just discussing this yesterday.
Flags: needinfo?(dburns)
Assignee: nobody → dburns
Status: NEW → ASSIGNED
Flags: needinfo?(dburns)
Attachment #8421939 - Flags: review?(mdas) → review+
Flags: needinfo?(ryanvm)
https://hg.mozilla.org/mozilla-central/rev/57cb8275056b
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
Can we back this out?

On Gu this has caused the whole Traceback to disappear:


06:40:17     INFO -  TEST-START test_homescreen_edit_mode.py
06:41:10     INFO -  test_access_and_leave_edit_mode (test_homescreen_edit_mode.TestEditMode) ... ERROR
06:41:11     INFO -  ======================================================================
06:41:11     INFO -  ERROR: None
06:41:11     INFO -  ----------------------------------------------------------------------
06:41:11    ERROR -  TEST-UNEXPECTED-FAIL | test_homescreen_edit_mode.py test_homescreen_edit_mode.TestEditMode.test_access_and_leave_edit_mode | ScriptTimeoutException: ScriptTimeoutException: timed out
06:41:11     INFO -  ----------------------------------------------------------------------
06:41:11     INFO -  Ran 1 test in 54.008s
06:41:11  WARNING -  FAILED (errors=1)
I'm happy to back this out temporarily, but we shouldn't be outputting a stacktrace anywhere IMO.

We should improve the content of the TEST-UNEXPECTED-FAIL line to include whatever line numbers amongst the rest of the stack that was useful for you - that way the info is more visible, since it will be in the log excerpt.
Thanks Ed.
We definitely need some information in there, we can't just have nothing!
In the case in the original description, the entire stack trace is useless, since JS files are executed using a single execute_async_script statement, and nothing in the traceback yields useful additional information.

In the case of Python tests, like gaia-ui-tests, the traceback points to which execute call is timing out, which is really important.
What I can do is have a it print the stack if it is a python test and ignore it if it is a JS test.

Is that a good compromise?

I do wonder if we should be better to raise a different exception for the JS tests
Flags: needinfo?(emorley)
wfm for now :-)
Status: RESOLVED → REOPENED
Flags: needinfo?(emorley)
Resolution: FIXED → ---
We also need to do the same for "TimeoutException: TimeoutException: Connection timed out"
I'm starring all Mnw "TimeoutException: TimeoutException: Connection timed out" failures generically (and have been since bug 948895 was resolved incomplete) due to this bug btw - since the bug suggestions list is too spammy to use in a timely manner. The try runs in comment 12 look good - let's get this landed! :-)
(In reply to Ryan VanderMeulen [:RyanVM UTC-4] from comment #13)
> We also need to do the same for "TimeoutException: TimeoutException:
> Connection timed out"

Timeout is actually useful since its a specific operation like loading a page. Script is overloaded since it can be run this arbitary bit of code or run this entire test.
(In reply to Ed Morley [:edmorley UTC+0] from comment #14)
> I'm starring all Mnw "TimeoutException: TimeoutException: Connection timed
> out" failures generically (and have been since bug 948895 was resolved
> incomplete) due to this bug btw - since the bug suggestions list is too
> spammy to use in a timely manner. The try runs in comment 12 look good -
> let's get this landed! :-)

While this looks good for a sheriff it doesnt look good for anyone else and doesnt meet the compromise in comment 10. 

New try 

https://tbpl.mozilla.org/?tree=Try&rev=e7b98f18835e
https://tbpl.mozilla.org/?tree=Try&rev=50fc89334c88
(In reply to David Burns :automatedtester from comment #16)
> While this looks good for a sheriff it doesnt look good for anyone else and
> doesnt meet the compromise in comment 10. 

Oh I thought I saw the tail end of a stack in the excerpt for gaia-ui tests; clearly not.
The try runs in comment 16 look better - is this ready to land now? :-)
Comment on attachment 8429612 [details] [diff] [review]
Print script timeout stacks if they came from a python test

Review of attachment 8429612 [details] [diff] [review]:
-----------------------------------------------------------------

::: testing/marionette/client/marionette/runner/base.py
@@ +230,5 @@
>                  if 'TEST-UNEXPECTED-FAIL' in line:
>                      fail_present = True
>              for line in err:
>                  if line != lastline or fail_present:
> +                    if re.match('.*\.js', test_name):

or just test_name.endswith('.js')?
Attachment #8429612 - Flags: review?(jgriffin) → review+
Discussed with jgriffin on irc. We can have situations where it can be testFile.js testClass.testName which the regex would handle. The Python tests report like that so if we make them the same we dont need to worry
https://hg.mozilla.org/mozilla-central/rev/af55ccf5219b
Status: REOPENED → RESOLVED
Closed: 10 years ago10 years ago
Resolution: --- → FIXED
Blocks: 1017559
Blocks: 1020296
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: