summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_threading.py
Commit message (Collapse)AuthorAgeFilesLines
* Issue #21963: backout issue #1856 patch (avoid crashes and lockups whenAntoine Pitrou2014-11-211-43/+0
| | | | | | daemon threads run while the interpreter is shutting down; instead, these threads are now killed when they try to take the GIL), as it seems to break some existing code.
* Issue #22423: Unhandled exception in thread no longer causes unhandledSerhiy Storchaka2014-09-211-0/+79
| | | | AttributeError when sys.stderr is None.
* avoid crashes and lockups from daemon threads during interpreter shutdown ↵Benjamin Peterson2014-06-171-0/+43
| | | | (#1856)
* Issue #20532: Tests which use _testcapi now are marked as CPython only.Serhiy Storchaka2014-02-071-1/+2
|
* Issue #14432: Generator now clears the borrowed reference to the thread stateVictor Stinner2013-12-131-0/+43
| | | | | | | Fix a crash when a generator is created in a C thread that is destroyed while the generator is still used. The issue was that a generator contains a frame, and the frame kept a reference to the Python state of the destroyed C thread. The crash occurs when a trace function is setup.
* Issue #19572: More silently skipped tests explicitly skipped.Zachary Ware2013-12-101-12/+4
|
* Issue 19158: a rare race in BoundedSemaphore could allow .release() too often.Tim Peters2013-10-091-0/+17
| | | | (grafted from e06edc0c7a4951327f0c95ebeebccba6879a6063)
* Issue #18418: After fork(), reinit all threads states, not only active ones.Charles-François Natali2013-08-301-0/+23
| | | | Patch by A. Jesse Jiryu Davis.
* Issue #14308: Fix an exception when a "dummy" thread is in the threading ↵Antoine Pitrou2012-04-191-0/+29
| | | | module's active list after a fork().
* 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.