[Zodb-checkins] CVS: ZODB4 - test.py:1.19
Jeremy Hylton
jeremy at zope.com
Thu Jun 26 17:57:28 EDT 2003
Update of /cvs-repository/ZODB4
In directory cvs.zope.org:/tmp/cvs-serv16512
Modified Files:
test.py
Log Message:
Add basic hooks for more detail debugging.
Avoid tracing a few common modules.
=== ZODB4/test.py 1.18 => 1.19 ===
--- ZODB4/test.py:1.18 Tue Jun 24 18:25:23 2003
+++ ZODB4/test.py Thu Jun 26 16:57:27 2003
@@ -527,6 +527,8 @@
def __init__(self):
self.type2count = {}
self.type2all = {}
+ # Put types in self.interesting to get detailed stats for them.
+ self.interesting = {}
def update(self):
obs = sys.getobjects(0)
@@ -551,6 +553,13 @@
for delta1, delta2, t in ct:
if delta1 or delta2:
print "%-55s %8d %8d" % (t, delta1, delta2)
+ if t in self.interesting:
+ for o in obs:
+ if type(o) == t:
+ print sys.getrefcount(o), len(gc.get_referrers(o))
+ delta1 -= 1
+ if not delta1:
+ break
self.type2count = type2count
self.type2all = type2all
@@ -824,8 +833,10 @@
# status if on a false return value from main.
coverdir = os.path.join(os.getcwd(), "coverage")
import trace
+ ignoremods = ["os", "posixpath", "stat"]
tracer = trace.Trace(ignoredirs=[sys.prefix, sys.exec_prefix],
- trace=0, count=1)
+ ignoremods=ignoremods,
+ trace=False, count=True)
tracer.runctx("main(module_filter, test_filter, libdir)",
globals=globals(), locals=vars())
More information about the Zodb-checkins
mailing list