Closed Bug 1532630 Opened 6 years ago Closed 6 years ago

mozprocess broken on python 3.6+

Categories

(Testing :: Mozbase, defect, P2)

Version 3
defect

Tracking

(firefox68 fixed)

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: tarek, Assigned: tarek)

References

Details

Attachments

(1 file)

subprocess.Process._wait() can have a timeout option

ProcessHandlerMixin.Process._wait() should have one too

[task 2019-03-05T11:45:18.963Z]  0:52.01 =================================== FAILURES ===================================
[task 2019-03-05T11:45:18.963Z]  0:52.01 ______________ ProcTestPoll.test_poll_after_kill_no_process_group ______________
[task 2019-03-05T11:45:18.963Z]  0:52.01 
[task 2019-03-05T11:45:18.963Z]  0:52.01 self = <test_poll.ProcTestPoll testMethod=test_poll_after_kill_no_process_group>
[task 2019-03-05T11:45:18.963Z]  0:52.01 
[task 2019-03-05T11:45:18.963Z]  0:52.01     def test_poll_after_kill_no_process_group(self):
[task 2019-03-05T11:45:18.963Z]  0:52.01         """Process (no group) is killed, and poll() is called."""
[task 2019-03-05T11:45:18.963Z]  0:52.01         p = processhandler.ProcessHandler([self.python, self.proclaunch,
[task 2019-03-05T11:45:18.963Z]  0:52.01                                            "process_normal_finish_no_process_group.ini"],
[task 2019-03-05T11:45:18.963Z]  0:52.01                                           cwd=here,
[task 2019-03-05T11:45:18.963Z]  0:52.01                                           ignore_children=True
[task 2019-03-05T11:45:18.963Z]  0:52.01                                           )
[task 2019-03-05T11:45:18.963Z]  0:52.01         p.run()
[task 2019-03-05T11:45:18.964Z]  0:52.01 >       returncode = p.kill()
[task 2019-03-05T11:45:18.964Z]  0:52.01 
[task 2019-03-05T11:45:18.964Z]  0:52.01 testing/mozbase/mozprocess/tests/test_poll.py:70:
[task 2019-03-05T11:45:18.964Z]  0:52.01 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[task 2019-03-05T11:45:18.964Z]  0:52.01 testing/mozbase/mozprocess/mozprocess/processhandler.py:812: in kill
[task 2019-03-05T11:45:18.964Z]  0:52.01     self.proc.kill(sig=sig)
[task 2019-03-05T11:45:18.964Z]  0:52.01 testing/mozbase/mozprocess/mozprocess/processhandler.py:208: in kill
[task 2019-03-05T11:45:18.964Z]  0:52.01     self.returncode = self.wait()
[task 2019-03-05T11:45:18.964Z]  0:52.01 testing/mozbase/mozprocess/mozprocess/processhandler.py:229: in wait
[task 2019-03-05T11:45:18.964Z]  0:52.02     self.returncode = self._wait()
[task 2019-03-05T11:45:18.964Z]  0:52.02 testing/mozbase/mozprocess/mozprocess/processhandler.py:665: in _wait
[task 2019-03-05T11:45:18.964Z]  0:52.02     subprocess.Popen.wait(self)
[task 2019-03-05T11:45:18.964Z]  0:52.02 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[task 2019-03-05T11:45:18.964Z]  0:52.02 
[task 2019-03-05T11:45:18.964Z]  0:52.02 self = <mozprocess.processhandler.ProcessHandlerMixin.Process object at 0x10f97a3c8>
[task 2019-03-05T11:45:18.965Z]  0:52.02 timeout = None
[task 2019-03-05T11:45:18.965Z]  0:52.02 
[task 2019-03-05T11:45:18.965Z]  0:52.02     def wait(self, timeout=None):
[task 2019-03-05T11:45:18.965Z]  0:52.02         """Wait for child process to terminate; returns self.returncode."""
[task 2019-03-05T11:45:18.967Z]  0:52.02         if timeout is not None:
[task 2019-03-05T11:45:18.967Z]  0:52.02             endtime = _time() + timeout
[task 2019-03-05T11:45:18.967Z]  0:52.02         try:
[task 2019-03-05T11:45:18.967Z]  0:52.02 >           return self._wait(timeout=timeout)
[task 2019-03-05T11:45:18.967Z]  0:52.02 E           TypeError: _wait() got an unexpected keyword argument 'timeout'
[task 2019-03-05T11:45:18.967Z]  0:52.02 
[task 2019-03-05T11:45:18.967Z]  0:52.02 /tools/python37/lib/python3.7/subprocess.py:984: TypeError
Blocks: 1528992
No longer blocks: 1528992
Summary: mozprocess broken on python 3 → mozprocess broken on python 3.6+
Assignee: tarek → nobody

Make sure ProcessHandlerMixin.Process works also under 3.6.

3.6 introduced a _wait() method in its Popen class, that
conflicts with the one in mozprocess. The patch renames it
and also adds timeout where possible.

(In reply to Tarek Ziadé (:tarek) from comment #2)

https://treeherder.mozilla.org/#/
jobs?repo=try&revision=53cea0339e8a443fcdd0e4bf6fda4decf7bf7cfb

I couldn't see any test results here, nor in comment 1. Here's a new push:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=6cba2afeae02b335900498be6b6a31e709ba4686

Priority: -- → P2
See Also: → 1534647
See Also: → 1421289
Assignee: nobody → tarek

try run

https://treeherder.mozilla.org/#/jobs?repo=try&revision=5a1b30c9672a2abf68f26ab8fddadf61fe92b6e3

not that the mozfile failure is unrelated to this change

Pushed by tziade@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b52d5b669b43 mozprocess broken on python 3.6+ - r=gbrown
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: