Full logcat for Android 4.0 tests

RESOLVED FIXED

Status

Testing
General
RESOLVED FIXED
5 years ago
4 years ago

People

(Reporter: gbrown, Assigned: gbrown)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments)

(Assignee)

Description

5 years ago
Once the solution for full logcats for Android x86 is proven, I want to look at doing the same thing for Android 4.0 / Panda tests. This will be especially useful for resolving failures in Android 4.0 Debug tests.
(Assignee)

Comment 1

5 years ago
Created attachment 8367620 [details] [diff] [review]
(1) 'adb logcat' replacement using sut

Full logcats for Android x86 have proven useful and reliable. For Android x86, we launch "adb logcat" for the duration of a test job, redirecting output to the blobber upload directory. For Pandas, we don't use adb, so here's a replacement for "adb logcat", in the form of a python script that issues devicemanagerSUT commands. 

Running logcat is easy: Basically just "exec logcat", redirecting output to a specified file. 

Cleanup is slightly complicated. logcat.py provides for 2 ways of ending:
 - being signalled via SIGINT
 - timeout after 1 hour
In either case, we "clean up", which basically means killing the remote logcat process. (I expect this is going to happen at the end of a test job, just before the device is rebooted, but I want to avoid an accumulation of logcat processes in case the device is not rebooted, or logcat.py is being used in some unanticipated way.) 

Killing the remote process is complicated because most devicemanager / sutagent process operations only work on Android applications, like org.mozilla.fennec, but not on native processes, like logcat. We need to exec ps, parse its output to find the logcat pid, and then exec kill to end the logcat process.

This works fine for me in local testing on Pandaboards and phones.
Attachment #8367620 - Flags: review?(armenzg)
(Assignee)

Comment 2

5 years ago
Created attachment 8367622 [details] [diff] [review]
(2) use logcat.py to collect logcats during panda test jobs

I don't have a convenient way to test this. I'd like to land (1) and then test on ash.
Attachment #8367622 - Flags: review?(armenzg)

Updated

5 years ago
Attachment #8367620 - Flags: review?(armenzg) → review+

Updated

5 years ago
Attachment #8367622 - Flags: review?(armenzg) → review+
(Assignee)

Comment 4

4 years ago
Created attachment 8370366 [details] [diff] [review]
(3) cleanup logcat.py if necessary in checkStalled

Patch (2) kills logcat.py when the tests finish, but if that doesn't happen for some reason, this update to checkStalled should clean up any left-over "python -u logcat.py <ip> ..." processes.
Attachment #8370366 - Flags: review?(bugspam.Callek)

Updated

4 years ago
Attachment #8370366 - Flags: review?(bugspam.Callek) → review+

Updated

4 years ago
Depends on: 968190
(Assignee)

Comment 6

4 years ago
Successful trial of patch (2) at https://tbpl.mozilla.org/?tree=Ash&rev=53bb6beeb1dc.

Comment 8

4 years ago
Mozharness change live in production.
(Assignee)

Comment 9

4 years ago
All looks fine to me. 

Armen, Justin - thanks for your help!
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.