in marionette_transport File "/marionette_client_mozilla_b2g37_v2_2-0.1-py2.7.egg/marionette/runner/base.py", line 751, in run_tests if self.capabilities['device'] != 'desktop' and self.capabilities['browserName'] == 'B2G': marionette_client_mozilla_b2g37_v2_2-0.1-py2.7.egg/marionette/runner/base.py", line 574, in capabilities self.marionette.delete_session() File "/marionette_client_mozilla_b2g37_v2_2-0.1-py2.7.egg/marionette/marionette.py", line 839, in delete_session response = self._send_message('deleteSession', 'ok') File "/marionette_client_mozilla_b2g37_v2_2-0.1-py2.7.egg/marionette/decorators.py", line 36, in _ return func(*args, **kwargs) File "/marionette_client_mozilla_b2g37_v2_2-0.1-py2.7.egg/marionette/marionette.py", line 609, in _send_message response = self.client.send(message) File "/marionette_transport-0.4-py2.7.egg/marionette_transport/transport.py", line 96, in send self.sock.send(packet) AttributeError: 'NoneType' object has no attribute 'send' Looks like we didn't protect when sock is set as None.
Andreas, I found bug1157273 for marionette-server, are they related?
If `self.sock` isn’t defined on calling the `send` routine in marionette_transport, we reconnect on transport.py:86: if not self.sock: self.connect() The only slightly suspicious thing about is that we’re relying on the coerced boolean value of `self.sock` instead of explicitly testing for None-ness as such: if self.sock is not None: self.connect() I don’t think what you’re seeing is related to bug 1157273 as that is more a theoretical bug limited to the server. It _could_ potentially manifest itself if you create and delete a session very rapidly in succession, but as I said I don’t think it’s related. Do you have a reliable way to reproduce the error you’re seeing? From reading the code I can’t immediately think of anything that would cause this to happen. Perhaps some code is writing directly to transport.py’s internals and resetting `self.sock`, but that seems unlikely.
I triggered 5 machines yesterday and 1 of them reproduced in 2 hours. likely an unexpected flow and it didn't trigger reconnecting.
The `capabilities` routine in marionette/base.py also looks quite suspicious: https://dxr.mozilla.org/mozilla-central/source/testing/marionette/client/marionette/runner/base.py?from=marionette/runner/base.py#611
That is rational and I saw many failures with "self.capabilities". Probably we can maintain session other than use it disposable. Just check new test run and haven't encountered. We can inject log or patch at next run, any suggestion?
transport.py has changed significantly since this was filed.
Status: NEW → RESOLVED
Last Resolved: 9 months ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.