summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_fork1.py
Commit message (Collapse)AuthorAgeFilesLines
* Issue #7449, last part (11): fix many tests if thread support is disabledVictor Stinner2010-04-271-2/+2
| | | | | | * Use try/except ImportError or test_support.import_module() to import thread and threading modules * Add @unittest.skipUnless(threading, ...) to testcases using threads
* Remove unused imports in test modules.Georg Brandl2010-02-071-1/+0
|
* Fix issue #1590864, multiple threads and fork() can cause deadlocks, byThomas Wouters2009-09-161-0/+41
| | | | | | | | | | | | | | | | | | | | | | acquiring the import lock around fork() calls. This prevents other threads from having that lock while the fork happens, and is the recommended way of dealing with such issues. There are two other locks we care about, the GIL and the Thread Local Storage lock. The GIL is obviously held when calling Python functions like os.fork(), and the TLS lock is explicitly reallocated instead, while also deleting now-orphaned TLS data. This only fixes calls to os.fork(), not extension modules or embedding programs calling C's fork() directly. Solving that requires a new set of API functions, and possibly a rewrite of the Python/thread_*.c mess. Add a warning explaining the problem to the documentation in the mean time. This also changes behaviour a little on AIX. Before, AIX (but only AIX) was getting the import lock reallocated, seemingly to avoid this very same problem. This is not the right approach, because the import lock is a re-entrant one, and reallocating would do the wrong thing when forking while holding the import lock. Will backport to 2.6, minus the tiny AIX behaviour change.
* Change more tests to use import_module for the modules thatR. David Murray2009-03-301-2/+2
| | | | | should cause tests to be skipped. Also rename import_function to the more descriptive get_attribute and add a docstring.
* Add import_function method to test.test_support, and modify a number ofR. David Murray2009-03-301-6/+4
| | | | | | | | tests that expect to be skipped if imports fail or functions don't exist to use import_function and import_module. The ultimate goal is to change regrtest to not skip automatically on ImportError. Checking in now to make sure the buldbots don't show any errors on platforms I can't direct test on.
* Revert incorrect change.R. David Murray2009-03-301-3/+6
|
* Convert import try/except to use test_support.import_module().R. David Murray2009-03-301-6/+3
|
* add missing importBenjamin Peterson2009-03-301-0/+1
|
* fix incorrect auto-translation of TestSkipped -> unittest.SkipTestBenjamin Peterson2009-03-261-2/+2
|
* remove test_support.TestSkipped and just use unittest.SkipTestBenjamin Peterson2009-03-261-2/+2
|
* Restore rev 47014:Neal Norwitz2006-07-071-1/+9
| | | | | | | | | | | | | | | | The hppa ubuntu box sometimes hangs forever in these tests. My guess is that the wait is failing for some reason. Use WNOHANG, so we won't wait until the buildbot kills the test suite. I haven't been able to reproduce the failure, so I'm not sure if this will help or not. Hopefully, this change will cause the test to fail, rather than hang. That will be better since we will get the rest of the test results. It may also help us debug the real problem. *** The reason this originally failed was because there were many zombie children outstanding before rev 47158 cleaned them up. There are still hangs in test_subprocess that need to be addressed, but that will take more work. This should close some holes.
* Add new utility function, reap_children(), to test_support. This shouldNeal Norwitz2006-06-291-1/+2
| | | | | | | | | | be called at the end of each test that spawns children (perhaps it should be called from regrtest instead?). This will hopefully prevent some of the unexplained failures in the buildbots (hppa and alpha) during tests that spawn children. The problems were not reproducible. There were many zombies that remained at the end of several tests. In the worst case, this shouldn't cause any more problems, though it may not help either. Time will tell.
* Revert 47014 until it is more robustNeal Norwitz2006-06-181-9/+1
|
* The hppa ubuntu box sometimes hangs forever in these tests. My guessNeal Norwitz2006-06-181-1/+9
| | | | | | | | | | is that the wait is failing for some reason. Use WNOHANG, so we won't wait until the buildbot kills the test suite. I haven't been able to reproduce the failure, so I'm not sure if this will help or not. Hopefully, this change will cause the test to fail, rather than hang. That will be better since we will get the rest of the test results. It may also help us debug the real problem.
* Patch #1309579: wait3 and wait4 were added to the posix module by Chad J. ↵Neal Norwitz2006-03-201-64/+12
| | | | | | | | Schroeder. This was a fair amount of rework of the patch. Refactored test_fork1 so it could be reused by the new tests for wait3/4. Also made them into new style unittests (derive from unittest.TestCase).
* Oops, missed an import of test_support.Barry Warsaw2002-07-231-1/+1
|
* Unixware 7 support by Billy G. Allie (SF patch 413011)Guido van Rossum2001-04-111-1/+4
|
* Checking in patch #103478 -- makes popen2 and fork1 tested on BeOS.Moshe Zadka2001-01-301-9/+2
| | | | Tested for not breaking builds on Linux.
* This patch removes all uses of "assert" in the regression test suiteMarc-André Lemburg2001-01-171-4/+5
| | | | | | | and replaces them with a new API verify(). As a result the regression suite will also perform its tests in optimization mode. Written by Marc-Andre Lemburg. Copyright assigned to Guido van Rossum.
* Chris Herborth <chrish@pobox.com>:Fred Drake2000-08-151-0/+9
| | | | | | | | | Minor updates for BeOS R5. Use of OSError in test.test_fork1 changed to TestSkipped, with corresponding change in BeOS/README (by Fred). This closes SourceForge patch #100978.
* Raise 'TestSkipped' (from the test_support) module rather than 'ImportError'Thomas Wouters2000-08-041-1/+2
| | | | | to signify a test that should be marked as 'skipped' rather than 'failed'. Also 'document' it, in README.
* Raise ImportError when os.fork does not exist.Guido van Rossum2000-05-041-0/+5
|
* Added a provision to stop all threads before exiting from the test:Guido van Rossum2000-04-241-1/+7
| | | | | | the change to regrtest.py to unload all newly imported modules did something bad to the threads -- and I realized that they would never stop!
* Use a constant to specify the number of child threads to create.Fred Drake2000-04-101-4/+7
| | | | | | | | | | | Instead of assuming that the number process ids of the threads is the same as the process id of the controlling process, use a copy of the dictionary and check for changes in the process ids of the threads from the thread's process ids in the parent process. This makes the test make more sense on systems which assign a new pid to each thread (i.e., Linux). This doesn't fix the other problems evident with this test on Linux.
* Test case for fork1() behavior.Guido van Rossum2000-02-251-0/+54
Only the main thread should survive in the child after a fork().