Closed Bug 1466657 Opened 6 years ago Closed 6 years ago

[mozdevice] get_process_list sometimes fails (Android x86 7.0 emulator)

Categories

(Testing :: Mozbase, defect)

Version 3
defect
Not set
normal

Tracking

(firefox62 fixed)

RESOLVED FIXED
mozilla62
Tracking Status
firefox62 --- fixed

People

(Reporter: gbrown, Assigned: gbrown)

References

Details

Attachments

(1 file)

In bug 1460411, when I run mochitests on the Android x86 7.0 emulator, get_process_list intermittently fails. It looks like 'ps' returns no output. If I repeat the request, it usually succeeds.
https://treeherder.mozilla.org/logviewer.html#?job_id=180832250&repo=try&lineNumber=1101-1114

[task 2018-05-30T03:57:50.045Z] 03:57:50     INFO -  0 ERROR adb get_process_list:
[task 2018-05-30T03:57:50.045Z] 03:57:50     INFO -  Traceback (most recent call last):
[task 2018-05-30T03:57:50.045Z] 03:57:50     INFO -    File "/builds/worker/workspace/build/tests/mochitest/runtests.py", line 2802, in doTests
[task 2018-05-30T03:57:50.045Z] 03:57:50     INFO -      marionette_args=marionette_args,
[task 2018-05-30T03:57:50.046Z] 03:57:50     INFO -    File "/builds/worker/workspace/build/tests/mochitest/runtestsremote.py", line 321, in runApp
[task 2018-05-30T03:57:50.046Z] 03:57:50     INFO -      ret, _ = self.automation.runApp(*args, **kwargs)
[task 2018-05-30T03:57:50.046Z] 03:57:50     INFO -    File "/builds/worker/workspace/build/tests/mochitest/automation.py", line 531, in runApp
[task 2018-05-30T03:57:50.046Z] 03:57:50     INFO -      self.log.info("INFO | automation.py | Application pid: %d", proc.pid)
[task 2018-05-30T03:57:50.046Z] 03:57:50     INFO -    File "/builds/worker/workspace/build/tests/mochitest/remoteautomation.py", line 278, in pid
[task 2018-05-30T03:57:50.046Z] 03:57:50     INFO -      procs = self.device.get_process_list()
[task 2018-05-30T03:57:50.047Z] 03:57:50     INFO -    File "/builds/worker/workspace/build/venv/lib/python2.7/site-packages/mozdevice/adb.py", line 1994, in get_process_list
[task 2018-05-30T03:57:50.047Z] 03:57:50     INFO -      header, adb_process))
[task 2018-05-30T03:57:50.047Z] 03:57:50 CRITICAL -  ADBError: get_process_list: Unknown format: : args: adb -s emulator-5554 wait-for-device shell ps; echo rc=$?, exitcode: None, stdout:
[task 2018-05-30T03:57:50.047Z] 03:57:50     INFO -  1 ERROR Automation Error: Received unexpected exception while running application
:bc - Any thoughts? Retry when an empty/invalid header is returned from ps? Retry in get_process_list, or in the caller?
Flags: needinfo?(bob)
(Wish you were here!)
I would retry once in get_process_list. I wonder what is wrong with the emulator. I noticed a lot of messages about chatty dropping lines. We handled this in Autophone in bug 1360920. I wonder if that is related.
Flags: needinfo?(bob)
Depends on: 1468532
Comment on attachment 8985563 [details] [diff] [review]
retry 'ps' in get_process_list

Review of attachment 8985563 [details] [diff] [review]:
-----------------------------------------------------------------

r+ with style nit.

::: testing/mozbase/mozdevice/mozdevice/adb.py
@@ +2003,5 @@
> +                        continue
> +                    raise ADBError('get_process_list: Unknown format: %s: %s' % (
> +                        header, adb_process))
> +                else:
> +                    break

This is a bit more readable for me:

                if user_i != -1 and pid_i != -1:
                    break
                self._logger.error('get_process_list: %s' % header)
                if attempt >= max_attempts:
                    raise ADBError('get_process_list: Unknown format: %s: %s' %
                                   (header, adb_process))
Attachment #8985563 - Flags: review?(bob) → review+
Pushed by gbrown@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/8bd89325bde7
Retry Android 'ps' command on unexpected output; r=bc
https://hg.mozilla.org/mozilla-central/rev/8bd89325bde7
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
See Also: → 1509324
Summary: mozdevice get_process_list sometimes fails (Android x86 7.0 emulator) → [mozdevice] get_process_list sometimes fails (Android x86 7.0 emulator)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: