Closed Bug 1466657 Opened Last year Closed Last year

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


(Testing :: Mozbase, defect)

Version 3
Not set


(firefox62 fixed)

Tracking Status
firefox62 --- fixed


(Reporter: gbrown, Assigned: gbrown)


(Blocks 1 open bug)



(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.

[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/", 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/", 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/", line 531, in runApp
[task 2018-05-30T03:57:50.046Z] 03:57:50     INFO -"INFO | | Application pid: %d",
[task 2018-05-30T03:57:50.046Z] 03:57:50     INFO -    File "/builds/worker/workspace/build/tests/mochitest/", 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/", 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/
@@ +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:
                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
Retry Android 'ps' command on unexpected output; r=bc
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
Blocks: 1509614
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.