summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_threading.py
Commit message (Collapse)AuthorAgeFilesLines
* Skip test_threading.test_reinit_tls_after_fork() on platforms where fork()Charles-François Natali2012-02-081-0/+1
| | | | can't be called reliably from a worker thread.
* Issue #13817: After fork(), reinit the ad-hoc TLS implementation earlier to fixCharles-François Natali2012-02-021-0/+23
| | | | | a random deadlock when fork() is called in a multithreaded process in debug mode, and make PyOS_AfterFork() more robust.
* Issue #11870: Skip test_threading.test_2_join_in_forked_process() on platformsVictor Stinner2011-07-011-22/+13
| | | | | | | with known OS bugs Share the list of platforms with known OS bugs with other tests. Patch written by Charles-François Natali.
* Issue #9670: Increase the default stack size for secondary threads onNed Deily2011-05-281-0/+31
| | | | | | Mac OS X and FreeBSD to reduce the chances of a crash instead of a "maximum recursion depth" RuntimeError exception. (patch by Ronald Oussoren)
* Issue9670: Back out changeset b0d2b696da19; test fails on other platformsNed Deily2011-04-091-30/+0
| | | | and on OS X with pydebug.
* Issue #9670: Increase the default stack size for secondary threads onNed Deily2011-04-091-0/+30
| | | | | | Mac OS X and FreeBSD to reduce the chances of a crash instead of a "maximum recursion depth" RuntimeError exception. (Patch by Ronald Oussoren)
* #11565: Fix several typos. Patch by Piotr Kasprzyk.Ezio Melotti2011-03-161-1/+1
|
* Merged revisions 87710 via svnmerge fromGregory P. Smith2011-01-041-4/+148
| | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r87710 | gregory.p.smith | 2011-01-03 13:06:12 -0800 (Mon, 03 Jan 2011) | 4 lines issue6643 - Two locks held within the threading module on each thread instance needed to be reinitialized after fork(). Adds tests to confirm that they are and that a potential deadlock and crasher bug are fixed (platform dependant). ........ This required a bit more fiddling for 2.x as __block and __started are __ private as well as the __started Event's __cond. A new "private" _reset_internal_locks() method is added to Thread and _Event objects to address this.
* Merged revisions 86596 via svnmerge fromEzio Melotti2010-11-211-6/+6
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86596 | ezio.melotti | 2010-11-20 21:04:17 +0200 (Sat, 20 Nov 2010) | 1 line #9424: Replace deprecated assert* methods in the Python test suite. ........
* Merged revisions 86209 via svnmerge fromBrian Curtin2010-11-051-0/+4
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86209 | brian.curtin | 2010-11-05 12:22:46 -0500 (Fri, 05 Nov 2010) | 2 lines Close subprocess pipes to clean up ResourceWarnings ........
* Merged revisions 86107 via svnmerge fromBrian Curtin2010-11-021-0/+1
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86107 | brian.curtin | 2010-11-01 22:59:09 -0500 (Mon, 01 Nov 2010) | 2 lines Clean up ResourceWarnings. Explictly close stdout from the subprocess. ........
* Merged revisions 85586-85587,85596-85598 via svnmerge fromGregory P. Smith2010-10-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r85586 | gregory.p.smith | 2010-10-16 17:17:24 -0700 (Sat, 16 Oct 2010) | 2 lines fix for netbsd. ........ r85587 | gregory.p.smith | 2010-10-16 17:43:10 -0700 (Sat, 16 Oct 2010) | 3 lines applying netbsd-wizs-mod.patch from issue5510 - fixes for netbsd (and dragonflybsd?) ........ r85596 | gregory.p.smith | 2010-10-16 19:14:36 -0700 (Sat, 16 Oct 2010) | 6 lines Fix multiprocessing Semaphore's on netbsd5. SEM_VALUE_MAX is defined as (~0U) on NetBSD which was causing it to appear as -1 when used as a signed int for _multprocessing.SemLock.SEM_VALUE_MAX. This works around the problem by substituting INT_MAX on systems where it appears negative when used as an int. ........ r85597 | gregory.p.smith | 2010-10-16 19:57:19 -0700 (Sat, 16 Oct 2010) | 2 lines skip test_itimer_virtual on NetBSD to prevent the test suite from hanging. ........ r85598 | gregory.p.smith | 2010-10-16 20:09:12 -0700 (Sat, 16 Oct 2010) | 2 lines Avoid hanging the test on netbsd5. ........
* Merged revisions 84909-84913 via svnmerge fromAntoine Pitrou2010-09-201-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r84909 | antoine.pitrou | 2010-09-20 00:46:05 +0200 (lun., 20 sept. 2010) | 3 lines Try to fix test_subprocess on "x86 debian parallel 3.x" buildbot ........ r84910 | antoine.pitrou | 2010-09-20 01:06:53 +0200 (lun., 20 sept. 2010) | 3 lines Try to make signal-sending tests in test_subprocess more robust on slow machines ........ r84911 | antoine.pitrou | 2010-09-20 01:28:30 +0200 (lun., 20 sept. 2010) | 3 lines Make error more explicit in test_finalize_with_trace ........ r84912 | antoine.pitrou | 2010-09-20 02:12:19 +0200 (lun., 20 sept. 2010) | 3 lines Try to fix buildbot failure (#9902) ........ r84913 | antoine.pitrou | 2010-09-20 03:33:21 +0200 (lun., 20 sept. 2010) | 3 lines Try a more robust implementation of _kill_process ........
* 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
* Cleanup the test added in r78517 based on Ezio Melotti's feedback.Gregory P. Smith2010-03-011-8/+4
|
* Issue #7481: When a threading.Thread failed to start it would leave theGregory P. Smith2010-02-281-0/+19
| | | | instance stuck in initial state and present in threading.enumerate().
* use assert[Not]IsInstance where appropriateEzio Melotti2010-01-241-2/+1
|
* use assert[Not]In where appropriateEzio Melotti2010-01-231-2/+2
|
* Issue #7282: Fix a memory leak when an RLock was used in a thread otherAntoine Pitrou2009-11-091-4/+2
| | | | | than those started through `threading.Thread` (for example, using `thread.start_new_thread()`.
* Kill a small potential leak in test_threading.Antoine Pitrou2009-11-081-0/+2
| | | | | The leak may not manifest itself if the OS re-uses the same thread ids (I suppose Neal's machine doesn't :-))
* Issue #7270: Add some dedicated unit tests for multi-thread synchronizationAntoine Pitrou2009-11-061-17/+29
| | | | primitives such as Lock, RLock, Condition, Event and Semaphore.
* Suppress transient refleaks in test_threading.Antoine Pitrou2009-10-271-3/+12
|
* Fix Windows buildbot failureAntoine Pitrou2009-10-231-3/+2
|
* Test wouldn't work in debug mode.Antoine Pitrou2009-10-201-0/+1
| | | | We probably need a function in test_support to handle this.
* Issue #1722344: threading._shutdown() is now called in Py_Finalize(), whichAntoine Pitrou2009-10-201-0/+24
| | | | | fixes the problem of some exceptions being thrown at shutdown when the interpreter is killed. Patch by Adam Olsen.
* Add a comment about unreachable code, and fix a typoAntoine Pitrou2009-10-181-1/+3
|
* Add a test for same-thread asynchronous exceptions (see #1779233).Antoine Pitrou2009-10-181-0/+19
|
* convert usage of fail* to assert*Benjamin Peterson2009-06-301-15/+15
|
* fix Thread.ident when it is the main thread or a dummy thread #5632Benjamin Peterson2009-03-311-0/+13
|
* #1674032: return value of flag from Event.wait(). OKed by Guido.Georg Brandl2009-03-311-1/+2
|
* Works around issue3863: freebsd4/5/6 and os2emx are known to have OS bugs whenGregory P. Smith2008-09-301-0/+6
| | | | | | | calling fork() from a child thread. This disables that unit test (with a note printed to stderr) on those platforms. A caveat about buggy platforms is added to the os.fork documentation.
* backport threading property changesBenjamin Peterson2008-08-181-6/+6
|
* change threading.getIdent to a propertyBenjamin Peterson2008-08-181-2/+2
| | | | This is new in 2.6 so now need to worry about backwards compatibility :)
* try to fix test_threading on the Windows botBenjamin Peterson2008-07-171-1/+2
|
* Apply patch for 874900: threading module can deadlock after forkJesse Noller2008-07-161-1/+79
|
* give the threading API PEP 8 namesBenjamin Peterson2008-06-111-12/+12
|
* Adds a Thread.getIdent() method to provide the _get_ident() value forGregory P. Smith2008-06-011-0/+5
| | | | any given threading.Thread object. feature request issue 2871.
* #1733757: the interpreter would hang on shutdown, if the function set by ↵Amaury Forgeot d'Arc2008-04-031-0/+29
| | | | | | | | | | | | sys.settrace calls threading.currentThread. The correction somewhat improves the code, but it was close. Many thanks to the "with" construct, which turns python code into C calls. I wonder if it is not better to sys.settrace(None) just after running the __main__ module and before finalization.
* Kill a race in test_threading in which the exception info in a thread finishingJeffrey Yasskin2008-03-281-2/+6
| | | | | | | up after it was joined had a traceback pointing to that thread's (deleted) target attribute, while the test was trying to check that the target was destroyed. Big thanks to Antoine Pitrou for diagnosing the race and pointing out sys.exc_clear() to kill the exception early. This fixes issue 2496.
* Speed test_threading up from 14s to .5s, and avoid a deadlock on certainJeffrey Yasskin2008-03-211-25/+28
| | | | | | | | failures. The test for enumerate-after-join is now a little less rigorous, but the bug it references says the error happened in the first couple iterations, so 100 iterations should still be enough. cProfile was useful for identifying the slow tests here.
* Followup to r61011: Also avoid the reference cycle when the Thread's targetJeffrey Yasskin2008-02-231-3/+11
| | | | raises an exception.
* Prevent classes like:Jeffrey Yasskin2008-02-231-0/+20
| | | | | | | | | | | | | | class RunSelfFunction(object): def __init__(self): self.thread = threading.Thread(target=self._run) self.thread.start() def _run(self): pass from creating a permanent cycle between the object and the thread by having the Thread delete its references to the object when it completes. As an example of the effect of this bug, paramiko.Transport inherits from Thread to avoid it.
* - Fix Issue #1703448: A joined thread could show up in theGregory P. Smith2008-01-221-0/+18
| | | | | threading.enumerate() list after the join() for a brief period until it actually exited.
* Issue #1402: PyInterpreterState_Clear() may still invoke user codeAmaury Forgeot d'Arc2007-11-291-0/+34
| | | | | | | | (in deallocation of running threads, for example), so the PyGILState_Release() function must still be functional. On the other hand, _PyGILState_Fini() only frees memory, and can be called later. Backport candidate, but only after some experts comment on it.
* Patch #1731049: make threading.py use a proper "raise" when checking ↵Collin Winter2007-06-061-1/+41
| | | | internal state, rather than assert statements (which get stripped out by -O).
* test_PyThreadState_SetAsyncExc(): This is failing on someTim Peters2006-08-111-3/+4
| | | | | | | | | | | 64-bit boxes. I have no idea what the ctypes docs mean by "integers", and blind-guessing here that it intended to mean the signed C "int" type, in which case perhaps I can repair this by feeding the thread id argument to type ctypes.c_long(). Also made the worker thread daemonic, so it doesn't hang Python shutdown if the test continues to fail.
* Followup to bug #1069160.Tim Peters2006-08-101-0/+69
| | | | | | PyThreadState_SetAsyncExc(): internal correctness changes wrt refcount safety and deadlock avoidance. Also added a basic test case (relying on ctypes) and repaired the docs.
* test_threading now skips testing alternate thread stack sizes onAndrew MacIntyre2006-08-061-2/+12
| | | | platforms that don't support changing thread stack size.
* Increase the small thread stack size to get the testAndrew MacIntyre2006-06-131-3/+3
| | | | | to pass reliably on the one buildbot that insists on more than 32kB of thread stack.
* Patch #1454481: Make thread stack size runtime tunable.Andrew MacIntyre2006-06-131-0/+16
| | | | | | | | | | Heavily revised, comprising revisions: 46640 - original trunk revision (backed out in r46655) 46647 - markup fix (backed out in r46655) 46692:46918 merged from branch aimacintyre-sf1454481 branch tested on buildbots (Windows buildbots had problems not related to these changes).