Skip to content

Commit

Permalink
Improve memory leak check stability
Browse files Browse the repository at this point in the history
- Instead of choosing index 1 and 4, choose 5 and 9
  for memory leak check.

Signed-off-by: Gigon Bae <[email protected]>
  • Loading branch information
gigony committed Oct 31, 2023
1 parent f95e100 commit fd4c525
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 fd4c525

Please sign in to comment.