[issue1029] cpython test_subprocess.py fails
New submission from Garen Parham <garen.p@gmail.com>: On Ubuntu Linux 11.10, pypy trunk currently fails one of the modified test_subproces.py unit tests like so: garen@ubuntu:~/dev/bins$ ~/dev/bins/pypy-c-jit-51842-457e2166648c-linux/bin/pypy ~/dev/bins//pypy-c-jit-51842-457e2166648c-linux/lib-python/modified- 2.7/test/test_subprocess.py ... ====================================================================== FAIL: test_executable_without_cwd (__main__.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/garen/dev/bins//pypy-c-jit-51842-457e2166648c-linux/lib- python/modified-2.7/test/test_subprocess.py", line 163, in test_executable_without_cwd self.assertEqual(p.returncode, 47) AssertionError: 1 != 47 ====================================================================== FAIL: test_executable_without_cwd (__main__.ProcessTestCaseNoPoll) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/garen/dev/bins//pypy-c-jit-51842-457e2166648c-linux/lib- python/modified-2.7/test/test_subprocess.py", line 163, in test_executable_without_cwd self.assertEqual(p.returncode, 47) AssertionError: 1 != 47 Also, the test_subprocess.py shipped with the latest cpython 2.7.2.5 has several new tests that also fail: ====================================================================== ERROR: test_communicate_epipe_only_stdin (__main__.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "./Python-2.7.2/Lib/test/test_subprocess.py", line 617, in test_communicate_epipe_only_stdin p.communicate("x" * 2**20) File "/home/garen/dev/bins/pypy-c-jit-51842-457e2166648c-linux/lib- python/modified-2.7/subprocess.py", line 729, in communicate self.stdin.write(input) IOError: [Errno 32] Broken pipe: '<fdopen>' ====================================================================== ERROR: test_close_fd_0 (__main__.POSIXProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "./Python-2.7.2/Lib/test/test_subprocess.py", line 830, in test_close_fd_0 self.check_close_std_fds([0]) File "./Python-2.7.2/Lib/test/test_subprocess.py", line 821, in check_close_std_fds err = test_support.strip_python_stderr(err) AttributeError: 'module' object has no attribute 'strip_python_stderr' ====================================================================== ERROR: test_close_fd_1 (__main__.POSIXProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "./Python-2.7.2/Lib/test/test_subprocess.py", line 833, in test_close_fd_1 self.check_close_std_fds([1]) File "./Python-2.7.2/Lib/test/test_subprocess.py", line 821, in check_close_std_fds err = test_support.strip_python_stderr(err) AttributeError: 'module' object has no attribute 'strip_python_stderr' ====================================================================== ERROR: test_close_fd_2 (__main__.POSIXProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "./Python-2.7.2/Lib/test/test_subprocess.py", line 836, in test_close_fd_2 self.check_close_std_fds([2]) File "./Python-2.7.2/Lib/test/test_subprocess.py", line 821, in check_close_std_fds err = test_support.strip_python_stderr(err) AttributeError: 'module' object has no attribute 'strip_python_stderr' ====================================================================== ERROR: test_close_fds_0_1 (__main__.POSIXProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "./Python-2.7.2/Lib/test/test_subprocess.py", line 839, in test_close_fds_0_1 self.check_close_std_fds([0, 1]) File "./Python-2.7.2/Lib/test/test_subprocess.py", line 821, in check_close_std_fds err = test_support.strip_python_stderr(err) AttributeError: 'module' object has no attribute 'strip_python_stderr' ====================================================================== ERROR: test_close_fds_0_1_2 (__main__.POSIXProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "./Python-2.7.2/Lib/test/test_subprocess.py", line 850, in test_close_fds_0_1_2 self.check_close_std_fds([0, 1, 2]) File "./Python-2.7.2/Lib/test/test_subprocess.py", line 821, in check_close_std_fds err = test_support.strip_python_stderr(err) AttributeError: 'module' object has no attribute 'strip_python_stderr' ====================================================================== ERROR: test_close_fds_0_2 (__main__.POSIXProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "./Python-2.7.2/Lib/test/test_subprocess.py", line 842, in test_close_fds_0_2 self.check_close_std_fds([0, 2]) File "./Python-2.7.2/Lib/test/test_subprocess.py", line 821, in check_close_std_fds err = test_support.strip_python_stderr(err) AttributeError: 'module' object has no attribute 'strip_python_stderr' ====================================================================== ERROR: test_close_fds_1_2 (__main__.POSIXProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "./Python-2.7.2/Lib/test/test_subprocess.py", line 845, in test_close_fds_1_2 self.check_close_std_fds([1, 2]) File "./Python-2.7.2/Lib/test/test_subprocess.py", line 821, in check_close_std_fds err = test_support.strip_python_stderr(err) AttributeError: 'module' object has no attribute 'strip_python_stderr' ====================================================================== ERROR: test_communicate_epipe (__main__.ProcessTestCaseNoPoll) ---------------------------------------------------------------------- Traceback (most recent call last): File "./Python-2.7.2/Lib/test/test_subprocess.py", line 609, in test_communicate_epipe p.communicate("x" * 2**20) File "/home/garen/dev/bins/pypy-c-jit-51842-457e2166648c-linux/lib- python/modified-2.7/subprocess.py", line 740, in communicate return self._communicate(input) File "/home/garen/dev/bins/pypy-c-jit-51842-457e2166648c-linux/lib- python/modified-2.7/subprocess.py", line 1263, in _communicate stdout, stderr = self._communicate_with_select(input) File "/home/garen/dev/bins/pypy-c-jit-51842-457e2166648c-linux/lib- python/modified-2.7/subprocess.py", line 1365, in _communicate_with_select bytes_written = os.write(self.stdin.fileno(), chunk) OSError: [Errno 32] Broken pipe ====================================================================== ERROR: test_communicate_epipe_only_stdin (__main__.ProcessTestCaseNoPoll) ---------------------------------------------------------------------- Traceback (most recent call last): File "./Python-2.7.2/Lib/test/test_subprocess.py", line 617, in test_communicate_epipe_only_stdin p.communicate("x" * 2**20) File "/home/garen/dev/bins/pypy-c-jit-51842-457e2166648c-linux/lib- python/modified-2.7/subprocess.py", line 729, in communicate self.stdin.write(input) IOError: [Errno 32] Broken pipe: '<fdopen>' ====================================================================== FAIL: test_executable_without_cwd (__main__.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "./Python-2.7.2/Lib/test/test_subprocess.py", line 163, in test_executable_without_cwd self.assertEqual(p.returncode, 47) AssertionError: 1 != 47 ====================================================================== FAIL: test_wait_when_sigchild_ignored (__main__.POSIXProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "./Python-2.7.2/Lib/test/test_subprocess.py", line 860, in test_wait_when_sigchild_ignored " non-zero with this error:\n%s" % stderr) AssertionError: sigchild_ignore.py exited non-zero with this error: Traceback (most recent call last): File "app_main.py", line 51, in run_toplevel File "/home/garen/dev/bins/Python- 2.7.2/Lib/test/subprocessdata/sigchild_ignore.py", line 6, in <module> subprocess.Popen([sys.executable, '-c', 'print("albatross")']).wait() File "/home/garen/dev/bins/pypy-c-jit-51842-457e2166648c-linux/lib- python/modified-2.7/subprocess.py", line 1247, in wait pid, sts = _eintr_retry_call(os.waitpid, self.pid, 0) File "/home/garen/dev/bins/pypy-c-jit-51842-457e2166648c-linux/lib- python/modified-2.7/subprocess.py", line 471, in _eintr_retry_call return func(*args) OSError: [Errno 10] No child processes ====================================================================== FAIL: test_executable_without_cwd (__main__.ProcessTestCaseNoPoll) ---------------------------------------------------------------------- Traceback (most recent call last): File "./Python-2.7.2/Lib/test/test_subprocess.py", line 163, in test_executable_without_cwd self.assertEqual(p.returncode, 47) AssertionError: 1 != 47 ---------------------------------------------------------------------- Ran 127 tests in 23.897s FAILED (failures=3, errors=10, skipped=14) Traceback (most recent call last): File "app_main.py", line 51, in run_toplevel File "./Python-2.7.2/Lib/test/test_subprocess.py", line 1053, in <module> test_main() File "./Python-2.7.2/Lib/test/test_subprocess.py", line 1049, in test_main test_support.run_unittest(*unit_tests) File "/home/garen/dev/bins/pypy-c-jit-51842-457e2166648c-linux/lib- python/modified-2.7/test/test_support.py", line 1138, in run_unittest _run_suite(suite) File "/home/garen/dev/bins/pypy-c-jit-51842-457e2166648c-linux/lib- python/modified-2.7/test/test_support.py", line 1092, in _run_suite raise TestFailed(err) TestFailed: multiple errors occurred At least a few of these appear to be related to some previously filed issues: https://bugs.pypy.org/issue934 https://bugs.pypy.org/issue828 ---------- messages: 3837 nosy: Garen, pypy-issue priority: bug release: ??? status: unread title: cpython test_subprocess.py fails ________________________________________ PyPy bug tracker <tracker@bugs.pypy.org> <https://bugs.pypy.org/issue1029> ________________________________________
Amaury Forgeot d Arc <amauryfa@gmail.com> added the comment: First, PyPy is currently at version 2.7.1. And it's a bit unfair to run 2.7.2 tests without 2.7.2 stdlib (cf. the error about strip_python_stderr). The first errors are interesting though, but I cannot reproduce them. OTOH this test is skipped by cpython, see http://bugs.python.org/issue7774 . PyPy should probably improve its sysconfig.is_python_build() function. ---------- nosy: +afa status: unread -> chatting ________________________________________ PyPy bug tracker <tracker@bugs.pypy.org> <https://bugs.pypy.org/issue1029> ________________________________________
Garen Parham <garen.p@gmail.com> added the comment: The test_subprocess.py file in pypy isn't much different, except it comments out SET_BINARY near the top of the file, and the newer cpython test_subprocess.py adds some additional tests. If I patch the local pypy test_subprocess.py by commenting out SET_BINARY and adding the new tests, I still see the same failures (though the strip_* errors being gone). Attached is the updated test_subprocess.py that can be run with your local pypy to eliminate the 2.7.1 vs 2.7.2 stdlib issue. Can you repro the errors now? ________________________________________ PyPy bug tracker <tracker@bugs.pypy.org> <https://bugs.pypy.org/issue1029> ________________________________________
Armin Rigo <armin.rigo@gmail.com> added the comment: Maybe you can try to look at the 'test_executable_without_cwd' failure more in detail. We cannot reproduce this one, so it's the only way to help: it works for us on various other linux distributions, as shown by the fact that pypy-c-jit-51842-457e2166648c's two testing columns are both green. ---------- nosy: +arigo ________________________________________ PyPy bug tracker <tracker@bugs.pypy.org> <https://bugs.pypy.org/issue1029> ________________________________________
Carl Friedrich Bolz <cfbolz@gmx.de> added the comment: we are by now on the 2.7.6 stdlib and test_subprocess.py passes (both the official one, and the attachment). closing this one. ---------- nosy: +cfbolz status: chatting -> resolved ________________________________________ PyPy bug tracker <tracker@bugs.pypy.org> <https://bugs.pypy.org/issue1029> ________________________________________
participants (4)
-
Amaury Forgeot d Arc
-
Armin Rigo
-
Carl Friedrich Bolz
-
Garen Parham