]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
cant reproduce buildbot's memory profiling, random fix attempt
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 10 May 2008 21:36:21 +0000 (21:36 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 10 May 2008 21:36:21 +0000 (21:36 +0000)
test/orm/memusage.py

index 845b19017801950f3614dd6fb29bc30c58f9a341..787b28d836955ccef6c1010a25ffa3f6f4debc13 100644 (file)
@@ -18,11 +18,11 @@ def profile_memory(func):
     # run the test 50 times.  if length of gc.get_objects()
     # keeps growing, assert false
     def profile(*args):
-        samples = []
+        samples = [0 for x in range(0, 50)]
         for x in range(0, 50):
             func(*args)
             gc.collect()
-            samples.append(len(gc.get_objects()))
+            samples[x] = len(gc.get_objects())
         print "sample gc sizes:", samples
 
         assert len(_sessions) == 0