Closed Bug 1516913 Opened 10 months ago Closed 10 months ago
_exitcode should handle the case in where the exitcode marker is not at EOF
:nbp noticed in bug 1511618 comment 9 that there was an inconsistency in how adb.py was detecting the exitcode of executed shell commands on the device. As you may recall, shell  appends echo rc=$? to the end of shell commands. _get_exitcode  the uses this sentinel to detect the exitcode of the shell command by matching the pattern rc=([0-9]+) at the end of stdout. This is necessary since adb shell does not provide us with that information. I added some "printf" style debugging statements and found that the rc=\d sentinal was not always found at the end of the stdout from executing a shell command. This causes intermittent failures in the jit-tests or any tests which expect a command to return a non-zero exit code.  <https://searchfox.org/mozilla-central/source/testing/mozbase/mozdevice/mozdevice/adb.py#1311>  <https://searchfox.org/mozilla-central/source/testing/mozbase/mozdevice/mozdevice/adb.py#856>
You can see an example of rc= not at the end of stdout in a test run using the debugging prints: <https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=219138344&repo=try&lineNumber=11230> This patch adds a fall back in the event that _get_exitcode does not find rc=([0-9]+) at the end of stdout to search the entirety of stdout for the pattern. Since there is a higher likelihood of finding an inappropriate match to the simple pattern rc=([0-9]+) somewhere, I've changed the sentinel to adb_returncode=([0-9]+) which should prevent accidental matches.
Attachment #9033712 - Flags: review?(jmaher)
10 months ago
Attachment #9033712 - Flags: review?(jmaher) → review+
You can see an example of all android tests run with this at <https://treeherder.mozilla.org/#/jobs?repo=try&tier=1%2C2%2C3&revision=1291ae38d35a4874c9c12a600e493707b162aac3> or the android-hw-p2 jittests at <https://treeherder.mozilla.org/#/jobs?repo=try&tier=1%2C2%2C3&revision=ff55a10dfb75e5824565a820fb32dfb1c36b1d96>. Thanks.
Pushed by email@example.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/8d7092d3884f [mozdevice] _get_exitcode should handle the case in where the exitcode marker is not at EOF, r=jmaher.
You need to log in before you can comment on or make changes to this bug.