Closed Bug 975085 Opened 6 years ago Closed 6 years ago

B2G emulator mochitest/reftests should work even if another device is attached


(Testing :: General, defect)

Gonk (Firefox OS)
Not set


(Not tracked)



(Reporter: ahal, Assigned: ahal)



(1 file)

This started happening after the mozbase sync in bug 949600. The error is:

DMError: unable to connect to device

  File "/home/ahal/git/B2G/gecko/testing/mochitest/", line 678, in run_mochitest_remote
    xre_path=self.xre_path, test_file=test_file, **kwargs)
  File "/home/ahal/git/B2G/gecko/testing/mochitest/", line 199, in run_b2g_test
    return mochitest.run_remote_mochitests(parser, options)
  File "/home/ahal/git/B2G/objdir-gecko/_tests/testing/mochitest/", line 319, in run_remote_mochitests
    dm = DeviceManagerADB(**kwargs)
  File "/home/ahal/git/B2G/gecko/testing/mozbase/mozdevice/mozdevice/", line 66, in __init__
  File "/home/ahal/git/B2G/gecko/testing/mozbase/mozdevice/mozdevice/", line 656, in _verifyDevice
    raise DMError("unable to connect to device")

This happens for both mochitest and reftest. I'm a little confused as nothing seems to have changed in the _verifyDevice method since the sync. Nevertheless, I noticed we are creating two devicemanager instances (one via marionette, one via the test runner) and it is the second instance that is failing. Creating this second instance shouldn't be necessary, and removing this call fixes the problem.
Annnd, I made the same mistake that I've helped countless other people diagnose in the past, I had another device connected via usb. Interestingly, as a result I now have a patch that allows me to run mochitests/reftests regardless of whether another device is attached. Patch coming soon.
Summary: B2G mochitest, reftest mach target failures | DMError unable to connect to device → B2G emulator mochitest/reftests should work even if another device is attached
tl;dr this patch makes it possible to run b2g emulator tests even when a separate device is attached.
Attachment #8379220 - Flags: review?(jgriffin)
No longer depends on: 949600
Comment on attachment 8379220 [details] [diff] [review]
Patch 1.0 - re-use emulator devicemanager instance in b2g tests

Review of attachment 8379220 [details] [diff] [review]:

Cool, this should help resolve one source of confusion I've seen a few times!
Attachment #8379220 - Flags: review?(jgriffin) → review+
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
You need to log in before you can comment on or make changes to this bug.