Closed Bug 1234577 Opened 4 years ago Closed 4 years ago

When BaseRunner.returncode is called on a non-interactive process handler, a raise is generated

Categories

(Testing :: Mozbase, defect)

defect
Not set

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: sydpolk, Unassigned)

References

Details

Attachments

(1 file)

10:26:19    ERROR -   2:29.95 LOG: MainThread ERROR Failure during test execution.
10:26:19     INFO -  Traceback (most recent call last):
10:26:19     INFO -    File "/Users/spolk/dev/testmozharness/build/venv/lib/python2.7/site-packages/marionette/runtests.py", line 71, in run
10:26:19     INFO -      runner.run_tests(tests)
10:26:19     INFO -    File "/Users/spolk/dev/testmozharness/build/venv/lib/python2.7/site-packages/marionette/runner/base.py", line 886, in run_tests
10:26:19     INFO -      self._print_summary(tests)
10:26:19     INFO -    File "/Users/spolk/dev/testmozharness/build/venv/lib/python2.7/site-packages/marionette/runner/base.py", line 929, in _print_summary
10:26:19     INFO -      self.marionette.instance.close()
10:26:19     INFO -    File "/Users/spolk/dev/testmozharness/build/venv/lib/python2.7/site-packages/marionette_driver/geckoinstance.py", line 144, in close
10:26:19     INFO -      self.runner.stop()
10:26:19     INFO -    File "/Users/spolk/dev/testmozharness/build/venv/lib/python2.7/site-packages/mozrunner/base/runner.py", line 152, in stop
10:26:19     INFO -      if not self.is_running():
10:26:19     INFO -    File "/Users/spolk/dev/testmozharness/build/venv/lib/python2.7/site-packages/mozrunner/base/runner.py", line 139, in is_running
10:26:19     INFO -      return self.returncode is None
10:26:19     INFO -    File "/Users/spolk/dev/testmozharness/build/venv/lib/python2.7/site-packages/mozrunner/base/runner.py", line 73, in returncode
10:26:19     INFO -      return self.process_handler.poll()
10:26:19    ERROR -  AttributeError: 'ProcessHandler' object has no attribute 'poll'
10:26:19    ERROR -  Exception AttributeError: AttributeError("'ProcessHandler' object has no attribute 'poll'",) in <bound method MediaTestRunner.cleanup of <__main__.MediaTestRunner object at 0x102b59090>> ignored
10:26:19    ERROR -  Exception AttributeError: AttributeError("'ProcessHandler' object has no attribute 'poll'",) in <bound method Marionette.__del__ of <marionette_driver.marionette.Marionette object at 0x102b59650>> ignored
10:26:19    ERROR -  Exception AttributeError: AttributeError("'ProcessHandler' object has no attribute 'poll'",) in <bound method GeckoRuntimeRunner.__del__ of <mozrunner.base.browser.GeckoRuntimeRunner object at 0x102b68550>> ignored
10:26:19    ERROR - Return code: 1

There are several other methods in this file which check to see whether the process_handler is a subclass of subprocess.Popen; that needs to be done here.
So, this bug only happens when I run my mozharness script in PyCharm, at least on my Mac. I don't know that this then meets the criteria as being worth the time.
https://reviewboard.mozilla.org/r/28987/#review26141

I'm not flagged as reviewer, but wanted to add some drive-by comments...

::: testing/mozbase/mozrunner/mozrunner/base/runner.py:79
(Diff revision 1)
> +                return self.process_handler.proc.poll()

I feel we should better add the `proc` property to the ProcessHandler class to keep compatibility as much as possible. Not sure why this doesn't exist yet.

::: testing/mozbase/mozrunner/setup.py:9
(Diff revision 1)
> -PACKAGE_VERSION = '6.11'
> +PACKAGE_VERSION = '6.12'

Version bumps should get their own changeset and even bug.
Comment on attachment 8701555 [details]
MozReview Request: Bug 1234577: Call poll() correctly for non-interactive process handlers; r?ahal

https://reviewboard.mozilla.org/r/28987/#review26165

I think this is an environment issue, because non-interactive ProcessHandler's most definitely do have a 'poll' method:
https://dxr.mozilla.org/mozilla-central/source/testing/mozbase/mozprocess/mozprocess/processhandler.py#756

I'd guess that somehow your pycharm environment is using a very old version of mozprocess. I don't know anything about pycharm, but could you try updating the mozprocess that pycharm is using? At any rate, we can't accept this patch because then the 'poll' method linked above will get replaced by subprocess.poll().
Attachment #8701555 - Flags: review?(ahalberstadt)
It definitely only happens in the Pycharm debugging environment. Withdrawing patch.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.