Closed Bug 962743 Opened 6 years ago Closed 6 years ago

Full logcat for Android 4.0 tests

Categories

(Testing :: General, defect)

x86
macOS
defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: gbrown, Assigned: gbrown)

References

Details

Attachments

(3 files)

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.
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)
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)
Attachment #8367620 - Flags: review?(armenzg) → review+
Attachment #8367622 - Flags: review?(armenzg) → review+
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)
Attachment #8370366 - Flags: review?(bugspam.Callek) → review+
Depends on: 968190
Successful trial of patch (2) at https://tbpl.mozilla.org/?tree=Ash&rev=53bb6beeb1dc.
Mozharness change live in production.
All looks fine to me. 

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