Commit Graph

4 Commits

Author SHA1 Message Date
Jun Wu
e9776efcd7 patchpython: fix test-check tests
Summary: Resolve pyflakes issues caused by patchpython.

Test Plan: `arc unit`

Reviewers: #sourcecontrol, durham

Reviewed By: durham

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D4051110

Signature: t1:4051110:1476985498:3582ddf70780537a7902fece3ab847bc9effd744
2016-10-20 16:03:31 +01:00
Jun Wu
3b12277d4a test-patchpython: do not rely on PYTHONPATH
Summary:
The `.py` tests are different from `.t` ones. They need special care about
`import`.

Also adds unlink `socketpath` to make sure the `.py` file runs directly
with python with additional effort to clean up the test dir.

Test Plan:
```
unset PYTHONPATH
run-tests.py test-patchpython.py
python2 test-patchpython.py
```

Reviewers: ttung, #mercurial, simonfar

Reviewed By: simonfar

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3579579

Signature: t1:3579579:1468848206:3711a4714080fbcc2d4360ded8316603be48fa25
2016-07-18 14:12:28 +01:00
Jun Wu
1ccadaecf2 test-patchpython: use hgext3rd
Summary: It's caught by the contbuild script. I forgot to change this test.

Test Plan: Run `test-patchpython.t`.

Reviewers: #mercurial, ttung, simonfar

Reviewed By: simonfar

Subscribers: simonfar, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3550459

Signature: t1:3550459:1468349937:07123651fb103d283a382d1323d9f69a5c5d81b7

Blame Revision: D3534311
2016-07-12 19:44:45 +01:00
Jun Wu
ab49fe9698 patchpython: new extension to patch buggy Python modules
Summary:
As discussed, we want to make sure we have a good SocketServer for Python 2.6,
which is unsupported by PSF but still being widely used by our users.

This diff adds a new extension that tries to fix buggy Python standard modules,
namely the SocketServer. It fixes a critical race condition for Python 2.6
(https://bugs.python.org/issue21491) and the zombie process issue for both
Python 2.6 and 2.7 (https://bugs.python.org/issue11109).

A simple test is added to check zombie processes are no more.

Test Plan:
Run the newly added test, `test-patchpython.py` with both Python 2.6 and 2.7.
Comment out the `import patchpython` line in the test and make sure it fails
on Python 2.6 and 2.7 with `AssertionError: zombie process detected`.

Reviewers: #mercurial, ttung, mjpieters

Reviewed By: mjpieters

Subscribers: simonfar, durham, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3384909

Signature: t1:3384909:1465319491:0ba64b496186712651b7ee6bd502d1e2ccac57d1
2016-06-03 11:11:30 +01:00