[CalendarServer-changes] [7719] CalendarServer/branches/users/glyph/disable-quota/txdav/common/ datastore/test/util.py
source_changes at macosforge.org
source_changes at macosforge.org
Thu Jul 7 02:34:02 PDT 2011
Revision: 7719
http://trac.macosforge.org/projects/calendarserver/changeset/7719
Author: glyph at apple.com
Date: 2011-07-07 02:34:01 -0700 (Thu, 07 Jul 2011)
Log Message:
-----------
docstrings for test-debugging utilities
Modified Paths:
--------------
CalendarServer/branches/users/glyph/disable-quota/txdav/common/datastore/test/util.py
Modified: CalendarServer/branches/users/glyph/disable-quota/txdav/common/datastore/test/util.py
===================================================================
--- CalendarServer/branches/users/glyph/disable-quota/txdav/common/datastore/test/util.py 2011-07-07 09:33:03 UTC (rev 7718)
+++ CalendarServer/branches/users/glyph/disable-quota/txdav/common/datastore/test/util.py 2011-07-07 09:34:01 UTC (rev 7719)
@@ -49,6 +49,9 @@
md5key = PropertyName.fromElement(TwistedGETContentMD5)
def allInstancesOf(cls):
+ """
+ Use L{gc.get_referrers} to retrieve all instances of a given class.
+ """
for o in gc.get_referrers(cls):
if isinstance(o, cls):
yield o
@@ -56,6 +59,12 @@
def dumpConnectionStatus():
+ """
+ Dump all L{DiagnosticConnectionWrapper} objects to standard output. This
+ function is useful for diagnosing connection leaks that corrupt state
+ between tests. (It is currently not invoked anywhere, but may be useful if
+ these types of bugs crop up in the future.)
+ """
print '+++ ALL CONNECTIONS +++'
for connection in allInstancesOf(DiagnosticConnectionWrapper):
print connection.label, connection.state
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110707/4f32cfb1/attachment-0001.html>
More information about the calendarserver-changes
mailing list