]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- allow the shrink phase for memusage to go until zeroed,
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 8 Aug 2017 18:02:16 +0000 (14:02 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 8 Aug 2017 18:02:16 +0000 (14:02 -0400)
some MySQL-env element is causing memory growth that goes very
far before stopping

Change-Id: Ic0882dd78636067980fceba4e3a969de78d5b26a

test/aaa_profiling/test_memusage.py

index 4a378d77dddc45d7d5eadbdd6ce26a91c928a533..771f376fc03c233eaef5e78adbfcdf7dd24e012f 100644 (file)
@@ -58,7 +58,10 @@ def profile_memory(maxtimes=250,
             max_ = 0
             max_grew_for = 0
             success = False
-            for y in range(maxtimes // 5):
+            until_maxtimes = 0
+            while True:
+                if until_maxtimes >= maxtimes // 5:
+                    break
                 for x in range(5):
                     func(*args)
                     gc_collect()
@@ -82,6 +85,7 @@ def profile_memory(maxtimes=250,
                     )
                     max_ = latest_max
                     max_grew_for += 1
+                    until_maxtimes += 1
                     continue
                 else:
                     print("Max remained at %s, %s more attempts left" %
@@ -90,8 +94,13 @@ def profile_memory(maxtimes=250,
                     if max_grew_for == 0:
                         success = True
                         break
-            else:
-                assert False, repr(samples)
+
+            if not success:
+                assert False, \
+                    "Ran for a total of %d times, memory kept growing: %r" % (
+                        maxtimes,
+                        samples
+                    )
 
             assert success
         return profile