I described Android test “complete logcats” last year in https://gbrownmozilla.wordpress.com/2014/02/12/complete-logcats-for-android-tests/, but a few details have changed since then, so here’s a re-write!

“Logcats” – those Android logs you see when you execute “adb logcat” – are an essential part of debugging Firefox for Android. We include logcats in our Android test logs on treeherder: After a test run, we run logcat on the device, collect the output and dump it to the test log. Sometimes those logcats are very useful; other times, they are too little, too late. A typical problem is that a failure occurs early in a test run, but does not cause the test to fail immediately; by the time the test ends, the fixed-size logcat buffer has filled up and overwritten the earlier, important messages. How frustrating!

All Android test jobs also offer “complete logcats”: logcat is run for the duration of the test job, the output is collected continuously, and dumped to a file. At the end of the test job, the file is uploaded to an aws server, and a link is displayed in treeherder. Here’s a sample of a treeherder summary, from the bottom right (you may need to resize or scroll to see the whole thing):


Notice the “artifact uploaded logcat.log” line? Open that link and you have a complete logcat showing what was happening on the device for the duration of the test job.

We have not changed the “old” logcat features in test logs: We still run logcat at the end of most jobs and dump the output to the test log. That might be more convenient in some cases.

Happy test debugging!