If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Provide a better error message when running b2g mochitests locally with a device attached which confuses adb

RESOLVED WONTFIX

Status

Testing
Mochitest
RESOLVED WONTFIX
4 years ago
4 years ago

People

(Reporter: Ehsan, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

When I run the test, the emulator window opens, then it sits there for a minute or so and then it dies with the following error message:

$ ./mach mochitest-remote layout/forms
From _tests: Kept 9190 existing; Added/updated 0; Removed 0 files and 0 directories.
waiting for system-message-listener-ready...
done
Error running mach:

    ['mochitest-remote', 'layout/forms']

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:

DMError: unable to connect to device

  File "/media/storage/moz/b2g-ics-emu/../../../../home/ehsan/moz/src/testing/mochitest/mach_commands.py", line 600, in run_mochitest_remote
    xre_path=self.xre_path, test_file=test_file, **kwargs)
  File "/media/storage/moz/b2g-ics-emu/../../../../home/ehsan/moz/src/testing/mochitest/mach_commands.py", line 185, in run_b2g_test
    return mochitest.run_remote_mochitests(parser, options)
  File "/home/ehsan/moz/b2g-ics-emu/objdir-gecko/_tests/testing/mochitest/runtestsb2g.py", line 311, in run_remote_mochitests
    dm = DeviceManagerADB(**kwargs)
  File "/media/storage/moz/b2g-ics-emu/../../../../home/ehsan/moz/src/testing/mozbase/mozdevice/mozdevice/devicemanagerADB.py", line 64, in __init__
    self._verifyDevice()
  File "/media/storage/moz/b2g-ics-emu/../../../../home/ehsan/moz/src/testing/mozbase/mozdevice/mozdevice/devicemanagerADB.py", line 712, in _verifyDevice
    raise DMError("unable to connect to device")
$ cat .userconfig 
export GECKO_PATH=/home/ehsan/moz/src
export NOFTU=1
export B2G_DEBUG=1

This blocks me from debugging bug 933883.
Hmm, I ran this mach target today using tip everything without problems. Is this with m-c/b2g master? I see you are using a custom gecko path, have you ran ./repo sync and re-built lately?
Yeah, this is the current master, and I ran ./repo sync just before building.

FWIW, I managed to get the underlying python script to run outside of mach, with the same result:

$ ./objdir-gecko/_virtualenv/bin/python ../src/testing/mochitest/runtestsb2g.py --b2gpath . --xre-path ./gaia/xulrunner-sdk/bin/xpcshell --console-level INFO --httpd-path ./ --emulator arm --test-manifest ./gecko/testing/mochitest/b2g.json --test-path layout/forms
.
waiting for system-message-listener-ready...
done
Traceback (most recent call last):
  File "../src/testing/mochitest/runtestsb2g.py", line 376, in <module>
    main()
  File "../src/testing/mochitest/runtestsb2g.py", line 373, in main
    run_remote_mochitests(parser, options)
  File "../src/testing/mochitest/runtestsb2g.py", line 311, in run_remote_mochitests
    dm = DeviceManagerADB(**kwargs)
  File "/media/storage/moz/src/testing/mozbase/mozdevice/mozdevice/devicemanagerADB.py", line 64, in __init__
    self._verifyDevice()
  File "/media/storage/moz/src/testing/mozbase/mozdevice/mozdevice/devicemanagerADB.py", line 712, in _verifyDevice
    raise DMError("unable to connect to device")
mozdevice.devicemanager.DMError: unable to connect to device
This could potentially happen if you have other devices connected to adb at the time you run the test; was that the case?
(In reply to comment #3)
> This could potentially happen if you have other devices connected to adb at the
> time you run the test; was that the case?

Hmm, not sure, this is a machine at the office, so I need to retry on Monday.
(In reply to Jonathan Griffin (:jgriffin) from comment #3)
> This could potentially happen if you have other devices connected to adb at
> the time you run the test; was that the case?

If that's the case we should morph this bug into being about having a better error message. Actually, we should fix it even if it's not the case :)
Yes, I think I did have another (Android) device attached at the same time.  With that removed, I can successfully run the tests.
Summary: Cannot run mochitests locally on an ICS Emulator build → Provide a better error message when running b2g mochitests locally with a device attached which confuses adb
No longer blocks: 933883
With the fix in bug 975085 it should now be possible to run emulator tests while a separate device is attached. This should no longer be needed.
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.