Closed
Bug 1516913
Opened 6 years ago
Closed 6 years ago
[mozdevice] _get_exitcode should handle the case in where the exitcode marker is not at EOF
Categories
(Testing :: Mozbase, defect)
Testing
Mozbase
Tracking
(firefox66 fixed)
RESOLVED
FIXED
mozilla66
Tracking | Status | |
---|---|---|
firefox66 | --- | fixed |
People
(Reporter: bc, Assigned: bc)
References
Details
Attachments
(1 file)
(deleted),
patch
|
jmaher
:
review+
|
Details | Diff | Splinter Review |
: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 [1] appends echo rc=$? to the end of shell commands. _get_exitcode [2] 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.
[1] <https://searchfox.org/mozilla-central/source/testing/mozbase/mozdevice/mozdevice/adb.py#1311>
[2] <https://searchfox.org/mozilla-central/source/testing/mozbase/mozdevice/mozdevice/adb.py#856>
Assignee | ||
Comment 1•6 years ago
|
||
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)
Updated•6 years ago
|
Attachment #9033712 -
Flags: review?(jmaher) → review+
Assignee | ||
Comment 2•6 years ago
|
||
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 bclary@mozilla.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.
Comment 4•6 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
status-firefox66:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
You need to log in
before you can comment on or make changes to this bug.
Description
•