Closed Bug 967252 Opened 7 years ago Closed 5 years ago

mach mochitest-remote TimeoutException: socket.timeout

Categories

(Firefox OS Graveyard :: General, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: grobinson, Unassigned)

References

Details

Until recently, I was able to run mochitests on B2G locally with "mach mochitest-remote". At some point in early January, I pulled m-c and brought in changes that broke this functionality. My setup is as follows:

1) ./config.sh emulator
2) ./build.sh
3) ./mach mochitest-remote MOCHITEST_PATH

Now, instead of a successful test run, the emulator starts and runs for ~10 minutes before exiting with a TimeoutException. I have tried this with several mochitests and always get the same result.

Here's the traceback:

garrett-ThinkPad-X1-Carbon :: ~/B2G ‹master› » ./mach mochitest-remote content/base/test/test_CrossSiteXHR.html

/home/garrett/B2G/../mozilla-central/python/mach/mach/main.py:246: UserWarning: Module mozprocess was already imported from /home/garrett/B2G/../mozilla-central/testing/mozbase/mozprocess/mozprocess/__init__.pyc, but /usr/local/lib/python2.7/dist-packages/mozprocess-0.9-py2.7.egg is being added to sys.path
  import pkg_resources
/home/garrett/B2G/../mozilla-central/python/mach/mach/main.py:246: UserWarning: Module mozfile was already imported from /home/garrett/B2G/../mozilla-central/testing/mozbase/mozfile/mozfile/__init__.pyc, but /usr/local/lib/python2.7/dist-packages/mozfile-0.5-py2.7.egg is being added to sys.path
  import pkg_resources
From _tests: Kept 11716 existing; Added/updated 0; Removed 0 files and 0 directories.
Error running mach:

    ['mochitest-remote', 'content/base/test/test_CrossSiteXHR.html']

The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.

You should consider filing a bug for this issue.

If filing a bug, please include the full output of mach, including this error
message.

The details of the failure are as follows:

TimeoutException: TimeoutException: socket.timeout


  File "/home/garrett/B2G/../mozilla-central/testing/mochitest/mach_commands.py", line 658, in run_mochitest_remote
    xre_path=self.xre_path, test_file=test_file, **kwargs)
  File "/home/garrett/B2G/../mozilla-central/testing/mochitest/mach_commands.py", line 193, in run_b2g_test
    return mochitest.run_remote_mochitests(parser, options)
  File "/home/garrett/B2G/objdir-gecko/_tests/testing/mochitest/runtestsb2g.py", line 311, in run_remote_mochitests
    marionette = Marionette.getMarionetteOrExit(**kwargs)
  File "/home/garrett/B2G/../mozilla-central/testing/marionette/client/marionette/marionette.py", line 553, in getMarionetteOrExit
    m = cls(*args, **kwargs)
  File "/home/garrett/B2G/../mozilla-central/testing/marionette/client/marionette/marionette.py", line 516, in __init__
    busybox=busybox)
  File "/home/garrett/B2G/../mozilla-central/testing/marionette/client/marionette/emulator.py", line 377, in setup
    self.wait_for_system_message(marionette)
  File "/home/garrett/B2G/../mozilla-central/testing/marionette/client/marionette/emulator.py", line 255, in wait_for_system_message
    marionette.start_session()
  File "/home/garrett/B2G/../mozilla-central/testing/marionette/client/marionette/marionette.py", line 716, in start_session
    self.session = self._send_message('newSession', 'value')
  File "/home/garrett/B2G/../mozilla-central/testing/marionette/client/marionette/marionette.py", line 602, in _send_message
    raise TimeoutException(message='socket.timeout', status=ErrorCodes.TIMEOUT, stacktrace=None)
Blocks: 859417, 858787
Component: Gaia::TestAgent → General
I can't reproduce this locally. Do you have another device attached to your machine by any chance? When you say "runs for ~10 minutes" do you mean it hangs? Or that tests are actually running and then it stops midway.
(In reply to Andrew Halberstadt [:ahal] from comment #1)
> When you say "runs for ~10 minutes" do you mean it hangs?
> Or that tests are actually running and then it stops midway.

I mean that it hangs for 10 minutes, then exits with the timeout exception.
Talked to jld and he pointed out that it might be something on my local machine blocking the connection to the Marionette server (maybe a firewall mis-configuration). I'm checking this now and will update this bug.
The problem is not due to my local setup. The build with problems was a debug build. At jld's suggestion, I did a non-debug build. The test now runs and no longer times out (although another issue with the test harness surfaced).

Are debug builds that much slower that they cause a socket timeout?

Either way, this is frustrating because it makes that I can run Mochitests, or use a debugger, but not both. Typically I want to do both.
debug emulators are super slow, it's a known problem.  :(  cc'ing gwagner in case he has any suggestions; he's done some work on debugging mochitests on debug emulators.
(In reply to Jonathan Griffin (:jgriffin) from comment #5)
> debug emulators are super slow, it's a known problem.  :( 

Ok, I'll try to get this done without the debugger.

> cc'ing gwagner in case he has any suggestions; he's done some work
> on debugging mochitests on debug emulators.

If you have any tips, they would be greatly appreciated. I can't understand how anyone works like this :(
No longer blocks: 858787
A lot of the marionette code has been rewritten since this bug was opened so am closing this as we have solved all the other TimeoutException bugs. 

Feel free to reopen if this is still an issue.
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.