Marionette throws opaque error if gecko is closed while session is active

RESOLVED FIXED

Status

Testing
Marionette
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: jgriffin, Assigned: automatedtester)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
See c.f. bug 756085.  When a marionette session is active and gecko is closed, the Python testrunner shows this very unhelpful error message:

Traceback (most recent call last):
  File "../mats_runner\mats_runner.py", line 63, in start
    print self.marionette.navigate(self.url)
  File "E:\mozbase-win32\lib\site-packages\marionette-0.2-py2.7.egg\marionette\m
arionette.py", line 271, in navigate
    response = self._send_message('goUrl', 'ok', value=url)
  File "E:\mozbase-win32\lib\site-packages\marionette-0.2-py2.7.egg\marionette\m
arionette.py", line 160, in _send_message
    response = self.client.send(message)
  File "E:\mozbase-win32\lib\site-packages\marionette-0.2-py2.7.egg\marionette\c
lient.py", line 111, in send
    response = self.receive()
  File "E:\mozbase-win32\lib\site-packages\marionette-0.2-py2.7.egg\marionette\c
lient.py", line 78, in receive
    response += self._recv_n_bytes(int(length) + 1 + len(length) - 10)
ValueError: invalid literal for int() with base 10: ''

This happens because the socket is closed, but the Python client isn't handling this well.
(Assignee)

Updated

6 years ago
Assignee: nobody → dburns
(Assignee)

Comment 1

6 years ago
Created attachment 626375 [details] [diff] [review]
Handle nothing coming from socket and error
Attachment #626375 - Flags: review?(jgriffin)
(Reporter)

Comment 2

6 years ago
Comment on attachment 626375 [details] [diff] [review]
Handle nothing coming from socket and error

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

Looks great, thanks!

::: testing/marionette/client/marionette/client.py
@@ +53,1 @@
>  

Let's replace 'browser' with 'gecko', since our target isn't always a browser, and let's add ', socket closed?' to the end to indicate to the most likely cause of this error.
Attachment #626375 - Flags: review?(jgriffin) → review+
(Assignee)

Comment 4

6 years ago
landed in https://github.com/mozilla/marionette_client/commit/4b5d016be3fa9a21f1fdd16e922dcaf2db6188a5
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.