Rev 4528: Remove -Dlock from the test suite, in preparation for using it elsewhere. in http://bazaar.launchpad.net/~jameinel/bzr/1.18-lock-warnings
John Arbash Meinel
john at arbash-meinel.com
Thu Jul 30 21:44:39 BST 2009
At http://bazaar.launchpad.net/~jameinel/bzr/1.18-lock-warnings
------------------------------------------------------------
revno: 4528
revision-id: john at arbash-meinel.com-20090730204421-ei0b6opu4h9njsta
parent: john at arbash-meinel.com-20090730204232-94zudysc03qoi3rx
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 1.18-lock-warnings
timestamp: Thu 2009-07-30 15:44:21 -0500
message:
Remove -Dlock from the test suite, in preparation for using it elsewhere.
-------------- next part --------------
=== modified file 'bzrlib/help_topics/en/debug-flags.txt'
--- a/bzrlib/help_topics/en/debug-flags.txt 2009-07-24 03:15:56 +0000
+++ b/bzrlib/help_topics/en/debug-flags.txt 2009-07-30 20:44:21 +0000
@@ -18,10 +18,11 @@
-Dhpss Trace smart protocol requests and responses.
-Dhpssdetail More hpss details.
-Dhpssvfs Traceback on vfs access to Remote objects.
--Dhttp Trace http connections, requests and responses
+-Dhttp Trace http connections, requests and responses.
-Dindex Trace major index operations.
-Dknit Trace knit operations.
--Dlock Trace when lockdir locks are taken or released.
+-Dlock Trace when OS locks are potentially used in a non-portable
+ manner.
-Dmerge Emit information for debugging merges.
-Dunlock Some errors during unlock are treated as warnings.
-Dpack Emit information about pack operations.
=== modified file 'bzrlib/tests/__init__.py'
--- a/bzrlib/tests/__init__.py 2009-07-30 20:42:32 +0000
+++ b/bzrlib/tests/__init__.py 2009-07-30 20:44:21 +0000
@@ -802,7 +802,6 @@
self._benchcalls = []
self._benchtime = None
self._clear_hooks()
- # Track locks - needs to be called before _clear_debug_flags.
self._track_locks()
self._clear_debug_flags()
TestCase._active_threads = threading.activeCount()
@@ -859,10 +858,7 @@
def _check_locks(self):
"""Check that all lock take/release actions have been paired."""
# once we have fixed all the current lock problems, we can change the
- # following code to always check for mismatched locks, but only do
- # traceback showing with -Dlock (self._lock_check_thorough is True).
- # For now, because the test suite will fail, we only assert that lock
- # matching has occured with -Dlock.
+ # following code to always check for mismatched locks
# unhook:
acquired_locks = [lock for action, lock in self._lock_actions
if action == 'acquired']
@@ -878,16 +874,11 @@
message = ('Different number of acquired and '
'released or broken locks. (%s, %s + %s)' %
(acquired_locks, released_locks, broken_locks))
- if not self._lock_check_thorough:
- # Rather than fail, just warn
- print "Broken test %s: %s" % (self, message)
- return
self.fail(message)
def _track_locks(self):
"""Track lock activity during tests."""
self._lock_actions = []
- self._lock_check_thorough = 'lock' not in debug.debug_flags
self.addCleanup(self._check_locks)
_mod_lock.Lock.hooks.install_named_hook('lock_acquired',
self._lock_acquired, None)
More information about the bazaar-commits
mailing list