Closed Bug 1367197 Opened 7 years ago Closed 6 years ago

[mozdevice] Using mozregression on Windows, mozdevice 0.50 fails to launch Fennec on my phone

Categories

(Testing :: Mozbase, defect, P3)

All
Windows
defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1434664

People

(Reporter: JanH, Unassigned)

Details

Attachments

(2 files)

Attached file mozdevice problems.txt
My phone: Moto G4 Play, stock Android 6.0.1, rooted

With mozdevice 0.47 or 0.48, mozregression is working fine.
With mozdevice 0.50 (required by mozregression 2.3.11 or newer), Fennec fails to start.
:bc, do you have any ideas based on the above log? It looks like mozdevice is having troubles setting a testroot using Jan's phone?
Flags: needinfo?(bob)
I think that's a red herring - I don't see any difference between 0.48 and 0.50 in that regard and besides, it seems like its simply trying various common paths for finding the internal storage. Since my phone doesn't have /storage/sdcard0/ (the correct path on my phone would be /storage/emulated/0/), the first attempts naturally fail, however going via /sdcard/ - which *is* available on my phone as an alternative - eventually succeeds.
(In reply to Jan Henning [:JanH] from comment #2)
> I think that's a red herring - I don't see any difference between 0.48 and
> 0.50 in that regard and besides, it seems like its simply trying various
> common paths for finding the internal storage. Since my phone doesn't have
> /storage/sdcard0/ (the correct path on my phone would be
> /storage/emulated/0/), the first attempts naturally fail, however going via
> /sdcard/ - which *is* available on my phone as an alternative - eventually
> succeeds.

Hmm, you're probably right. It's the " 0:33.90 ERROR: Unable to start the application" message that's most suspicious. It looks like mozregression ultimately uses the launch_fennec method of mozdevice:

https://github.com/mozilla/mozregression/blob/5b986a3165a5208dd0722d6fc882b47e7fc1b627/mozregression/launchers.py#L360
http://searchfox.org/mozilla-central/rev/2933592c4a01b634ab53315ce2d0e43fccb82181/testing/mozbase/mozdevice/mozdevice/adb_android.py#358

I'd still be interested to hear :bc's read on this.
C:\Python27\Scripts\mozregression...

Ah, Windows. This might be part of the problem.

It appears that releases of mozregression continued after mozdevice 0.50 which contained the fixes for the adb push issues with adb >= 1.0.36. These even contained fixes related to running Fennec. zapion and wlach made the fennec changes after mozdevice 0.50. I wonder if they tested on Linux or OS X and not Windows?

You are running adb 1.0.36

Not sure how relevant this is:

 0:08.13 INFO: Setting SELinux Permissive Mode
 0:08.24 WARNING: Unable to set SELinux Permissive due to %s.

First, we are failing to set permissive mode and second we are failing to output the exception. I bet mozlog structured logging doesn't support passing the logging variables as arguments and require they be string interpolated. I see a fix in mozregression to make a very similar change, so I guess we'll need to make adb*.py interpolate its logging.

0:33.90 ERROR: Unable to start the application

Wonder why? Can you get the logcat from the attempt?
Flags: needinfo?(wlachance)
Flags: needinfo?(jh+bugzilla)
Flags: needinfo?(bob)
(In reply to Bob Clary [:bc:] from comment #4)
> C:\Python27\Scripts\mozregression...
> 
> Ah, Windows. This might be part of the problem.
> 
> It appears that releases of mozregression continued after mozdevice 0.50
> which contained the fixes for the adb push issues with adb >= 1.0.36. These
> even contained fixes related to running Fennec. zapion and wlach made the
> fennec changes after mozdevice 0.50. I wonder if they tested on Linux or OS
> X and not Windows?

Yeah I only tested on Linux.

>  0:08.13 INFO: Setting SELinux Permissive Mode
>  0:08.24 WARNING: Unable to set SELinux Permissive due to %s.
> 
> First, we are failing to set permissive mode and second we are failing to
> output the exception. I bet mozlog structured logging doesn't support
> passing the logging variables as arguments and require they be string
> interpolated. I see a fix in mozregression to make a very similar change, so
> I guess we'll need to make adb*.py interpolate its logging.

Filed bug 1367465 for this.

> 0:33.90 ERROR: Unable to start the application
> 
> Wonder why? Can you get the logcat from the attempt?

Yeah an adb logcat would be quite instructive now that I think about it.
Flags: needinfo?(wlachance)
Attached file mozdevice-logcat.7z
I've updated ADB to 1.0.39 just to be on the safe side, but with no different outcome.

In any case here's a logcat, although I'm not sure whether it contains something interesting: Searching for "fennec" only shows how we're de- and then re-installing Firefox.

(In reply to Bob Clary [:bc:] from comment #4)
> C:\Python27\Scripts\mozregression...
> 
> Ah, Windows. This might be part of the problem.

Hmm, I've tried running mozregression on the Linux VM I use for actual development work and it's indeed working there. There, even with mozdevice 0.50 the mozregression log looks just like the 0.48 log on Windows, i.e. no "WARNING: Unable to set SELinux Permissive due to %s." line and instead of "ERROR: Unable to start the application" the big output from get_process_list and Firefox starts up successfully on my phone.
Flags: needinfo?(jh+bugzilla)
OS: Android → Windows
Summary: [mozdevice] Using mozregression, mozdevice 0.50 fails to launch Fennec on my phone → [mozdevice] Using mozregression on Windows, mozdevice 0.50 fails to launch Fennec on my phone
You also appear to have a custom build of fennec installed. Can you delete it, reboot and try again?

You are trying to run 2016-09-19--mozilla-central--fennec-52.0a1.multi.android-arm.apk ?  Are you able to manually install and run that build?

Can you change the range to see if a later/different date will work?
(In reply to Bob Clary [:bc:] from comment #7)
> You also appear to have a custom build of fennec installed. Can you delete
> it, reboot and try again?

No difference.

> You are trying to run
> 2016-09-19--mozilla-central--fennec-52.0a1.multi.android-arm.apk ?  Are you
> able to manually install and run that build?

The package installs fine even with mozdevice 0.50. The only thing that fails is launching the app through mozdevice 0.50 on Windows - manually launching the app, running mozregression on Linux or using mozdevice 0.48 all work.

> Can you change the range to see if a later/different date will work?

No difference.
Also happens on a different computer running Windows 10.
I think we ought to stop using mozdevice in mozregression, we don't use 90% of its functionality and there seems to be some tension between covering the automation use case (where we typically use a rooted phone) and mozregression's (where we typically use an unrooted one). A very simple wrapper around adb should do the trick here; we could even potentially bundle an adb executable with the gui version of mozregression.

If anyone wants to do this I can give some guidance. Otherwise I'll try to find the time at some point...
Priority: -- → P3
This old bug is almost certainly a duplicate of bug 1434664.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → DUPLICATE
I guess I'll risk it and update mozregression on one my computers to test this.
Yes, current mozregression is working again for bisecting Fennec from Windows.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: