Closed Bug 1284560 Opened 8 years ago Closed 8 years ago

'mach mochitest' (or robocop, reftest) fails on android (4.3 emulator) - prefs not read from profile

Categories

(Firefox for Android Graveyard :: Testing, defect, P1)

49 Branch
defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1285040

People

(Reporter: gbrown, Assigned: gbrown)

References

Details

I cannot run tests with 'mach mochitest' on the android 4.3 emulator. In the emulator, it looks like the harness cannot contact the web server.

$ ./mach mochitest testing/mochitest/tests/Harness_sanity

######
### Now running mochitest-plain.
######

 0:01.68 LOG: MainThread INFO Android sdk version '18'; will use this to filter manifests
 0:01.85 LOG: MainThread INFO Checking for orphan ssltunnel processes...
 0:01.90 LOG: MainThread INFO Checking for orphan xpcshell processes...
 0:01.95 SUITE_START: MainThread 29
 0:01.95 TEST_START: MainThread testing/mochitest/tests/Harness_sanity/test_SpecialPowersPushAppPermissions.html
 0:01.95 TEST_END: MainThread SKIP
 0:01.95 TEST_START: MainThread testing/mochitest/tests/Harness_sanity/test_TestsRunningAfterSimpleTestFinish.html
 0:01.95 TEST_END: MainThread SKIP
 0:01.95 TEST_START: MainThread testing/mochitest/tests/Harness_sanity/test_bug816847.html
 0:01.95 TEST_END: MainThread SKIP
 0:01.95 TEST_START: MainThread testing/mochitest/tests/Harness_sanity/test_sanityEventUtils.html
 0:01.95 TEST_END: MainThread SKIP
 0:01.95 TEST_START: MainThread testing/mochitest/tests/Harness_sanity/test_sanity_manifest.html
 0:01.95 TEST_END: MainThread SKIP
 0:01.95 TEST_START: MainThread testing/mochitest/tests/Harness_sanity/test_sanity_manifest_pf.html
 0:01.95 TEST_END: MainThread SKIP
pk12util: PKCS12 IMPORT SUCCESSFUL
 0:38.25 LOG: MainThread INFO MochitestServer : launching [u'/home/gbrown/.mozbuild/android-device/host-utils-37.0a2.en-US.linux-x86_64/xpcshell', '-g', '/home/gbrown/.mozbuild/android-device/host-utils-37.0a2.en-US.linux-x86_64', '-v', '170', '-f', '/home/gbrown/.mozbuild/android-device/host-utils-37.0a2.en-US.linux-x86_64/components/httpd.js', '-e', "const _PROFILE_PATH = '/tmp/tmp9hC1wM.mozrunner'; const _SERVER_PORT = '8888'; const _SERVER_ADDR = '192.168.0.81'; const _TEST_PREFIX = undefined; const _DISPLAY_RESULTS = false;", '-f', '/home/gbrown/objdirs/droid/_tests/testing/mochitest/server.js']
 0:38.26 LOG: MainThread INFO runtests.py | Server pid: 9888
 0:38.27 LOG: MainThread INFO runtests.py | Websocket server pid: 9891
 0:38.28 LOG: MainThread INFO runtests.py | SSL tunnel pid: 9896
 1:05.32 LOG: MainThread INFO runtests.py | Running with e10s: False
 1:05.32 LOG: MainThread INFO runtests.py | Running tests: start.

INFO | automation.py | Application pid: 9898
INFO | automation.py | Application ran for: 0:00:25.716229
INFO | zombiecheck | Reading PID log: /tmp/tmpwQ_dRdpidlog
MOZ_UPLOAD_DIR not defined; tombstone check skipped
 1:31.73 LOG: MainThread INFO Stopping web server
 1:31.76 LOG: MainThread INFO Stopping web socket server
 1:31.78 LOG: MainThread INFO Stopping ssltunnel
 1:31.80 LOG: MainThread INFO WARNING | leakcheck | refcount logging is off, so leaks can't be detected!
 1:31.80 LOG: MainThread INFO runtests.py | Running tests: end.
 1:31.88 LOG: MainThread WARNING Unable to retrieve log file (/storage/sdcard/tests/logs/mochitest.log) from remote device
 1:32.36 SUITE_END: MainThread 
Summary
=======

Ran 6 tests
Expected results: 0
Unexpected results: 0
Skipped: 6

OK

######
### Now running mochitest-plain with subsuite clipboard.
######

 1:33.99 LOG: MainThread INFO Android sdk version '18'; will use this to filter manifests
 1:34.20 LOG: MainThread INFO Checking for orphan ssltunnel processes...
 1:34.25 LOG: MainThread INFO Checking for orphan xpcshell processes...
 1:34.35 SUITE_START: MainThread 1
pk12util: PKCS12 IMPORT SUCCESSFUL
 2:10.54 LOG: MainThread INFO MochitestServer : launching [u'/home/gbrown/.mozbuild/android-device/host-utils-37.0a2.en-US.linux-x86_64/xpcshell', '-g', '/home/gbrown/.mozbuild/android-device/host-utils-37.0a2.en-US.linux-x86_64', '-v', '170', '-f', '/home/gbrown/.mozbuild/android-device/host-utils-37.0a2.en-US.linux-x86_64/components/httpd.js', '-e', "const _PROFILE_PATH = '/tmp/tmp3IDWJK.mozrunner'; const _SERVER_PORT = '8888'; const _SERVER_ADDR = '192.168.0.81'; const _TEST_PREFIX = undefined; const _DISPLAY_RESULTS = false;", '-f', '/home/gbrown/objdirs/droid/_tests/testing/mochitest/server.js']
 2:10.54 LOG: MainThread INFO runtests.py | Server pid: 13185
 2:10.56 LOG: MainThread INFO runtests.py | Websocket server pid: 13188
 2:10.59 LOG: MainThread INFO runtests.py | SSL tunnel pid: 13205
 2:38.09 LOG: MainThread INFO runtests.py | Running with e10s: False
 2:38.10 LOG: MainThread INFO runtests.py | Running tests: start.

INFO | automation.py | Application pid: 11602
INFO | automation.py | Application ran for: 0:00:25.992777
INFO | zombiecheck | Reading PID log: /tmp/tmp6rGDQ2pidlog
MOZ_UPLOAD_DIR not defined; tombstone check skipped
 3:04.75 LOG: MainThread INFO Stopping web server
 3:04.78 LOG: MainThread INFO Stopping web socket server
 3:04.79 LOG: MainThread INFO Stopping ssltunnel
 3:04.81 LOG: MainThread INFO WARNING | leakcheck | refcount logging is off, so leaks can't be detected!
 3:04.82 LOG: MainThread INFO runtests.py | Running tests: end.
 3:04.86 LOG: MainThread WARNING Unable to retrieve log file (/storage/sdcard/tests/logs/mochitest.log) from remote device
 3:05.37 SUITE_END: MainThread 
Summary
=======

Ran 0 tests
Expected results: 0
Unexpected results: 0

OK
On 4.3 emulator and 4.3 device, my logcats show:

I/GeckoConsole( 2304): Couldn't show snippets because cache does not exist yet.
I/Gecko   ( 2304): MulticastDNS: stopDiscovery("_mozilla_papi._tcp.")
I/Gecko   ( 2304): MulticastDNS: _onStopListening() 2152398850
I/Gecko   ( 2304): FATAL ERROR: Non-local network connections are disabled and a connection attempt to location.services.mozilla.com (52.48.129.161) was made.
I/Gecko   ( 2304): You should only access hostnames available via the test networking proxy (if running mochitests) or from a test-specific httpd.js server (if running xpcshell tests). Browser services should be disabled or redirected to a local server.
Snippets.js is seeing browser.snippets.enabled = True, even though the on-device test profile contains:

  user.js:user_pref("browser.snippets.enabled", false);

Not reading the test profile?
Priority: -- → P1
When tests are run against the same changeset on treeherder, Preferences.loadPrefFile() is called on /storage/sdcard/tests/profile/user.js and /storage/sdcard/tests/profile/prefs.js; locally, those calls never happen.
Summary: 'mach mochitest' fails on android (4.3 emulator) → 'mach mochitest' (or robocop, reftest) fails on android (4.3 emulator) - prefs not read from profile
This seems to affect autophone too. I'm hitting the exact same issue when running autophone on a nexus 6p (android 6.0.1). Running mochitests directly fails before it gets this far as described in bug 1284575
Depends on: 1285040
(In reply to Geoff Brown [:gbrown] from comment #3)
> When tests are run against the same changeset on treeherder,
> Preferences.loadPrefFile() is called on
> /storage/sdcard/tests/profile/user.js and
> /storage/sdcard/tests/profile/prefs.js; locally, those calls never happen.

Those calls never happened because device manager mistakenly pushed user.js and prefs.js to /storage/sdcard/tests/profile/tmp/user.js and .../tmp/prefs.js. No .js files were in .../profile itself.

Device manager misbehaves when pushing directories (pushDir) with the latest (1.0.36) version of adb.

The wip fix for bug 1285040 pushes directories correctly regardless of adb version and fixes the problems I saw here. Verified with mach mochitest, mach robocop, and mach xpcshell-test using adb 1.0.36 and adb 1.0.32 and the 4.3 emulator and a Galaxy Nexus running 4.3.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
Depends on: 1353537
No longer depends on: 1353537
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.