summaryrefslogtreecommitdiffstats
path: root/Lib/test/lock_tests.py
Commit message (Collapse)AuthorAgeFilesLines
* bpo-35513: Replace time.time() with time.monotonic() in tests (GH-11182)Miss Islington (bot)2018-12-171-13/+13
| | | | | | | | | | Replace time.time() with time.monotonic() in tests to measure time delta. test_zipfile64: display progress every minute (60 secs) rather than every 5 minutes (5*60 seconds). (cherry picked from commit 2cf4c202ffeb30787c944365ba54013688b854c2) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-32692: Fix test_threading.test_set_and_clear() (GH-8331)Miss Islington (bot)2018-07-191-2/+3
| | | | | | | | Increase the timeout: give timeout x 4 instead of timeout x 2 to threads to wait until the Event is set, but reduce the sleep from 500 ms to 250 ms. So the test should be more reliable and faster! (cherry picked from commit 81950495ba2c36056e0ce48fd37d514816c26747) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-32208: update threading.Semaphore docs and add unit test (#4709)Garrett Berg2017-12-071-2/+4
| | | | | | | | | | * fix issue32208: update threading.Semaphore docs and add unit test to validate correct behavior * add test for blocking * Update threading.rst * semaphore: remove documentation validation tests and move 'return value' test to BaseSemaphore
* bpo-31234: Add test.support.wait_threads_exit() (#3578)Victor Stinner2017-09-141-15/+17
| | | | Use _thread.count() to wait until threads exit. The new context manager prevents the "dangling thread" warning.
* bpo-31234: Try to fix lock_tests warning (#3557)Victor Stinner2017-09-131-0/+8
| | | | | | | Try to fix the "Warning -- threading_cleanup() failed to cleanup 1 threads" warning in test.lock_tests: wait a little bit longer to give time to the threads to complete. Warning seen on test_thread and test_importlib.
* bpo-30727: Fix a race condition in test_threading. (#2334)Serhiy Storchaka2017-06-231-5/+14
|
* Issue #25551: Test condition behavior instead of its internalsBerker Peksag2016-04-291-4/+5
|\ | | | | | | | | | | | | | | | | | | test_reset_internal_locks was looking at Event's _cond._lock. This makes it harder to change internals of the Condition object and makes the test fragile. The test was added by Nir Soffer in 6108d30dde21. Patch by Nir Soffer.
| * Issue #25551: Test condition behavior instead of its internalsBerker Peksag2016-04-291-4/+5
| | | | | | | | | | | | | | | | | | | | test_reset_internal_locks was looking at Event's _cond._lock. This makes it harder to change internals of the Condition object and makes the test fragile. The test was added by Nir Soffer in 6108d30dde21. Patch by Nir Soffer.
* | Issue #25298: Add lock and rlock weakref tests (Contributed by Nir Soffer).Raymond Hettinger2015-10-091-0/+12
|/
* merge 3.4 (#25319)Benjamin Peterson2015-10-061-0/+8
|\
| * reinitialize an Event's Condition with a regular lock (closes #25319)Benjamin Peterson2015-10-061-0/+8
| |
* | Make some tests more frienly to MemoryError.Serhiy Storchaka2015-03-281-2/+6
|\ \ | |/ | | | | Free memory, unlock hanging threads.
| * Make some tests more frienly to MemoryError.Serhiy Storchaka2015-03-281-2/+6
| | | | | | | | Free memory, unlock hanging threads.
* | Issue 21137: Better repr for threading.Lock()Raymond Hettinger2014-05-261-1/+7
|/
* Issue #8799: Reduce timing sensitivity of condition test by explicitlyKristjan Valur Jonsson2013-11-111-0/+15
| | | | delaying the main thread so that it doesn't race ahead of the workers.
* Add simple test for repr(lock)Christian Heimes2013-07-301-0/+5
|
* Issue #9260: A finer-grained import lock.Antoine Pitrou2012-05-171-1/+11
| | | | | Most of the import sequence now uses per-module locks rather than the global import lock, eliminating well-known issues with threads and imports.
* Issue #13502: threading: Fix a race condition in Event.wait() that made itCharles-François Natali2012-01-071-0/+16
|\ | | | | | | return False when the event was set and cleared right after.
| * Issue #13502: threading: Fix a race condition in Event.wait() that made itCharles-François Natali2012-01-071-0/+16
| | | | | | | | return False when the event was set and cleared right after.
* | Issue #11871: In test_threading.BarrierTests, bump the default barrier timeoutCharles-François Natali2011-07-271-3/+3
|\ \ | |/ | | | | to avoid timing-dependent failures.
| * Issue #11871: In test_threading.BarrierTests, bump the default barrier timeoutCharles-François Natali2011-07-271-3/+3
| | | | | | | | to avoid timing-dependent failures.
* | Close #12028: Make threading._get_ident() public, rename it toVictor Stinner2011-05-301-2/+2
| | | | | | | | | | threading.get_ident() and document it. This function was used by _thread.get_ident().
* | (Merge 3.2) Issue #12096: Fix a race condition inVictor Stinner2011-05-171-1/+1
|\ \ | |/ | | | | test_threading.test_waitfor(). Patch written by Charles-François Natali.
| * Issue #12096: Fix a race condition in test_threading.test_waitfor(). PatchVictor Stinner2011-05-171-1/+1
| | | | | | | | written by Charles-François Natali.
* | Issue #11915: threading.RLock()._release_save() raises a RuntimeError if theVictor Stinner2011-04-241-0/+2
|/ | | | lock was not acquired.
* Try to fix sporadic failure in test_thread/test_threadingAntoine Pitrou2011-04-041-1/+7
|\
| * Try to fix sporadic failure in test_thread/test_threadingAntoine Pitrou2011-04-041-1/+7
| |
| * Merged revisions 76138,76173 via svnmerge fromAntoine Pitrou2009-11-091-0/+546
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r76138 | antoine.pitrou | 2009-11-06 23:41:14 +0100 (ven., 06 nov. 2009) | 10 lines Merged revisions 76137 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r76137 | antoine.pitrou | 2009-11-06 23:34:35 +0100 (ven., 06 nov. 2009) | 4 lines Issue #7270: Add some dedicated unit tests for multi-thread synchronization primitives such as Lock, RLock, Condition, Event and Semaphore. ........ ................ r76173 | antoine.pitrou | 2009-11-09 17:08:16 +0100 (lun., 09 nov. 2009) | 11 lines Merged revisions 76172 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r76172 | antoine.pitrou | 2009-11-09 17:00:11 +0100 (lun., 09 nov. 2009) | 5 lines Issue #7282: Fix a memory leak when an RLock was used in a thread other than those started through `threading.Thread` (for example, using `thread.start_new_thread()`. ........ ................
* Issue #11618: Fix the timeout logic in threading.Lock.acquire() underAntoine Pitrou2011-03-301-0/+10
| | | | Windows.
* Issue 10260Kristján Valur Jónsson2010-11-181-0/+40
| | | | Adding the wait_for() method to threading.Condition
* Use laxer timeouts in barrier testsAntoine Pitrou2010-11-171-5/+5
|
* issue 10237Kristján Valur Jónsson2010-10-311-4/+7
| | | | After increasing the default timeout for the barrier, the unittest for the default timeout must be adjusted
* issue 10237Kristján Valur Jónsson2010-10-301-1/+1
| | | | Increase the default timout of the barries used in the barrier tests. This should solve unexpected timeouts on some machines.
* issue 8777Kristján Valur Jónsson2010-10-281-0/+190
| | | | Add threading.Barrier
* #10218: return timeout status from Condition.wait, mirroring other ↵Georg Brandl2010-10-281-13/+19
| | | | primitives' behavior.
* Issue #850728: Add a *timeout* parameter to the `acquire()` method ofAntoine Pitrou2010-04-171-0/+13
| | | | `threading.Semaphore` objects. Original patch by Torsten Landschoff.
* Issue #7316: the acquire() method of lock objects in the :mod:`threading`Antoine Pitrou2010-04-141-5/+39
| | | | | | module now takes an optional timeout argument in seconds. Timeout support relies on the system threading library, so as to avoid a semi-busy wait loop.
* Merged revisions 76172 via svnmerge fromAntoine Pitrou2009-11-091-0/+13
| | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r76172 | antoine.pitrou | 2009-11-09 17:00:11 +0100 (lun., 09 nov. 2009) | 5 lines Issue #7282: Fix a memory leak when an RLock was used in a thread other than those started through `threading.Thread` (for example, using `thread.start_new_thread()`. ........
* Merged revisions 76137 via svnmerge fromAntoine Pitrou2009-11-061-0/+533
svn+ssh://pythondev@svn.python.org/python/trunk ........ r76137 | antoine.pitrou | 2009-11-06 23:34:35 +0100 (ven., 06 nov. 2009) | 4 lines Issue #7270: Add some dedicated unit tests for multi-thread synchronization primitives such as Lock, RLock, Condition, Event and Semaphore. ........