cpython: 454dceb5fd56 (original) (raw)

Mercurial > cpython

changeset 78790:454dceb5fd56

Issue #15794: Relax a test case due to the deadlock detection's conservativeness. [#15794]

Antoine Pitrou solipsis@pitrou.net
date Tue, 28 Aug 2012 20:10:18 +0200
parents 06497bbdf4fe
children 2e587b9bae35 263d09ce3e9e
files Lib/test/test_importlib/test_locks.py
diffstat 1 files changed, 18 insertions(+), 4 deletions(-)[+] [-] Lib/test/test_importlib/test_locks.py 22

line wrap: on

line diff

--- a/Lib/test/test_importlib/test_locks.py +++ b/Lib/test/test_importlib/test_locks.py @@ -1,4 +1,5 @@ from importlib import _bootstrap +import sys import time import unittest import weakref @@ -41,6 +42,17 @@ else: @unittest.skipUnless(threading, "threads needed for this test") class DeadlockAvoidanceTests(unittest.TestCase):

+

+ def run_deadlock_avoidance_test(self, create_deadlock): NLOCKS = 10 locks = [LockType(str(i)) for i in range(NLOCKS)] @@ -75,10 +87,12 @@ class DeadlockAvoidanceTests(unittest.Te def test_deadlock(self): results = self.run_deadlock_avoidance_test(True)

def test_no_deadlock(self): results = self.run_deadlock_avoidance_test(False)