diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2017-08-08 14:02:16 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2017-08-08 14:02:16 -0400 |
commit | 0a23654649e9b121001b24213bfa946409774e55 (patch) | |
tree | a8e1e15b505bcbbafd43df537233b9fc867bdd83 | |
parent | 68879d50faa9e2602e55d5d191647b1cf864e5ab (diff) | |
download | sqlalchemy-0a23654649e9b121001b24213bfa946409774e55.tar.gz |
- allow the shrink phase for memusage to go until zeroed,
some MySQL-env element is causing memory growth that goes very
far before stopping
Change-Id: Ic0882dd78636067980fceba4e3a969de78d5b26a
-rw-r--r-- | test/aaa_profiling/test_memusage.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/test/aaa_profiling/test_memusage.py b/test/aaa_profiling/test_memusage.py index 4a378d77d..771f376fc 100644 --- a/test/aaa_profiling/test_memusage.py +++ b/test/aaa_profiling/test_memusage.py @@ -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 |