Skip to content

Commit

Permalink
Improve memory leak check stability in test_read_region_cpu_memleak t…
Browse files Browse the repository at this point in the history
…est (#623)

There is a case where memory usage check is not stable enough:
#620 (comment)

Instead of choosing index 1 and 4 (among 5 samples), choose 5 and 9 (among 10 samples) for memory leak check.

Authors:
  - Gigon Bae (https://github.com/gigony)

Approvers:
  - Gregory Lee (https://github.com/grlee77)

URL: #623
  • Loading branch information
gigony authored Oct 31, 2023
1 parent a680cf6 commit 6d5b874
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ def test_read_region_cpu_memleak(testimg_tiff_stripe_4096x4096_256):

mem_usage_history = [process.memory_info().rss]

for i in range(5):
for i in range(10):
_ = img.read_region()
mem_usage_history.append(process.memory_info().rss)

print(mem_usage_history)

# Memory usage difference should be less than 1MB
assert mem_usage_history[4] - mem_usage_history[1] < 2**20 * 1
assert mem_usage_history[5] - mem_usage_history[9] < 2**20 * 1


def test_read_random_region_cpu_memleak(testimg_tiff_stripe_4096x4096_256):
Expand Down

0 comments on commit 6d5b874

Please sign in to comment.