Rev 3305: Add -Dselftest_debug debug flag. (Andrew Bennetts) in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Wed Mar 26 00:36:29 GMT 2008


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 3305
revision-id:pqm at pqm.ubuntu.com-20080326003617-r5xl8b8d6dqqor3w
parent: pqm at pqm.ubuntu.com-20080325083430-0w0gjtnkegce7718
parent: andrew.bennetts at canonical.com-20080325225322-ts3wqjjhnpoorb8c
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Wed 2008-03-26 00:36:17 +0000
message:
  Add -Dselftest_debug debug flag. (Andrew Bennetts)
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/debug.py                debug.py-20061102062349-vdhrw9qdpck8cl35-1
  bzrlib/help_topics/__init__.py help_topics.py-20060920210027-rnim90q9e0bwxvy4-1
  bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
  bzrlib/tests/test_osutils.py   test_osutils.py-20051201224856-e48ee24c12182989
    ------------------------------------------------------------
    revno: 3302.2.2
    revision-id:andrew.bennetts at canonical.com-20080325225322-ts3wqjjhnpoorb8c
    parent: andrew.bennetts at canonical.com-20080325071650-0hk9sdqc2au97xkg
    committer: Andrew Bennetts <andrew.bennetts at canonical.com>
    branch nick: selftest-debug-flags
    timestamp: Wed 2008-03-26 09:53:22 +1100
    message:
      Add -Dselftest_debug to bzrlib/help_topics/__init__.py.
    modified:
      bzrlib/help_topics/__init__.py help_topics.py-20060920210027-rnim90q9e0bwxvy4-1
    ------------------------------------------------------------
    revno: 3302.2.1
    revision-id:andrew.bennetts at canonical.com-20080325071650-0hk9sdqc2au97xkg
    parent: pqm at pqm.ubuntu.com-20080323231145-nh7pyfd19alqp471
    committer: Andrew Bennetts <andrew.bennetts at canonical.com>
    branch nick: selftest-debug-flags
    timestamp: Tue 2008-03-25 18:16:50 +1100
    message:
      Add -Dselftest_debug debug flag.
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/debug.py                debug.py-20061102062349-vdhrw9qdpck8cl35-1
      bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
      bzrlib/tests/test_osutils.py   test_osutils.py-20051201224856-e48ee24c12182989
=== modified file 'NEWS'
--- a/NEWS	2008-03-25 08:34:30 +0000
+++ b/NEWS	2008-03-26 00:36:17 +0000
@@ -63,6 +63,11 @@
 
   TESTING:
 
+    * New -Dselftest_debug flag disables clearing of the debug flags during
+      tests.  This is useful if you want to use e.g. -Dhpss to help debug a
+      failing test.  Be aware that using this feature is likely to cause
+      spurious test failures if used with the full suite. (Andrew Bennetts)
+
   INTERNALS:
 
 

=== modified file 'bzrlib/debug.py'
--- a/bzrlib/debug.py	2008-03-01 12:42:12 +0000
+++ b/bzrlib/debug.py	2008-03-25 07:16:50 +0000
@@ -38,5 +38,6 @@
  * lock - trace when lockdir locks are taken or released
  * merge - emit information for debugging merges
  * pack - emit information about pack operations
+ * selftest_debug - do not disable all debug flags when running selftest
 
 """

=== modified file 'bzrlib/help_topics/__init__.py'
--- a/bzrlib/help_topics/__init__.py	2008-03-01 12:42:12 +0000
+++ b/bzrlib/help_topics/__init__.py	2008-03-25 22:53:22 +0000
@@ -277,21 +277,22 @@
 A number of debug flags are also available to assist troubleshooting and
 development.
 
--Dauth         Trace authentication sections used.
--Derror        Instead of normal error handling, always print a traceback on
-               error.
--Devil         Capture call sites that do expensive or badly-scaling
-               operations.
--Dfetch        Trace history copying between repositories.
--Dhashcache    Log every time a working file is read to determine its hash.
--Dhooks        Trace hook execution.
--Dhpss         Trace smart protocol 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.
--Dmerge        Emit information for debugging merges.
--Dpack         Emit information about pack operations.
+-Dauth            Trace authentication sections used.
+-Derror           Instead of normal error handling, always print a traceback
+                  on error.
+-Devil            Capture call sites that do expensive or badly-scaling
+                  operations.
+-Dfetch           Trace history copying between repositories.
+-Dhashcache       Log every time a working file is read to determine its hash.
+-Dhooks           Trace hook execution.
+-Dhpss            Trace smart protocol 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.
+-Dmerge           Emit information for debugging merges.
+-Dpack            Emit information about pack operations.
+-Dselftest_debug  Do not disable all debug flags when running selftest.
 """
 
 _standard_options = \

=== modified file 'bzrlib/tests/__init__.py'
--- a/bzrlib/tests/__init__.py	2008-03-16 10:45:53 +0000
+++ b/bzrlib/tests/__init__.py	2008-03-25 07:16:50 +0000
@@ -811,9 +811,10 @@
         Tests that want to use debug flags can just set them in the
         debug_flags set during setup/teardown.
         """
-        self._preserved_debug_flags = set(debug.debug_flags)
-        debug.debug_flags.clear()
-        self.addCleanup(self._restore_debug_flags)
+        if 'selftest_debug' not in debug.debug_flags:
+            self._preserved_debug_flags = set(debug.debug_flags)
+            debug.debug_flags.clear()
+            self.addCleanup(self._restore_debug_flags)
 
     def _clear_hooks(self):
         # prevent hooks affecting tests

=== modified file 'bzrlib/tests/test_osutils.py'
--- a/bzrlib/tests/test_osutils.py	2008-03-07 20:24:05 +0000
+++ b/bzrlib/tests/test_osutils.py	2008-03-25 07:16:50 +0000
@@ -1118,6 +1118,7 @@
  * lock - trace when lockdir locks are taken or released
  * merge - emit information for debugging merges
  * pack - emit information about pack operations
+ * selftest_debug - do not disable all debug flags when running selftest
 
 """
 '''




More information about the bazaar-commits mailing list