From 9814fba9f4d3a8557033e40a0664e4f5ed3f4b66 Mon Sep 17 00:00:00 2001 From: leohsiao Date: Wed, 13 Dec 2023 22:25:47 +0800 Subject: [PATCH] [test] increase the loop count in test_memory_*() --- pyexiv2/tests/test_perf.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pyexiv2/tests/test_perf.py b/pyexiv2/tests/test_perf.py index b780d73..614d58d 100644 --- a/pyexiv2/tests/test_perf.py +++ b/pyexiv2/tests/test_perf.py @@ -5,7 +5,7 @@ def test_memory_leak_when_reading(): process = psutil.Process(os.getpid()) # memory_init = process.memory_info().rss - for i in range(100): + for i in range(1000): if i == 1: memory_1 = process.memory_info().rss test_func.test_read_exif() @@ -19,8 +19,8 @@ def test_memory_leak_when_reading(): test_func_on_convert.test_convert_xmp_to_exif() test_func_on_convert.test_convert_xmp_to_iptc() memory_end = process.memory_info().rss - delta = (memory_end - memory_1) / 1024 - assert delta < 100, 'Memory grew by {}KB, a memory leak may have occurred.'.format(delta) + delta = (memory_end - memory_1) / 1024 / 1024 + assert delta < 1, 'Memory grew by {}MB, a memory leak may have occurred.'.format(delta) # If img.close() hasn't been called, the memory can increase by more than 10MB. check_img_md5() @@ -28,7 +28,7 @@ def test_memory_leak_when_reading(): def test_memory_leak_when_writing(): process = psutil.Process(os.getpid()) # memory_init = process.memory_info().rss - for i in range(100): + for i in range(1000): if i == 1: memory_1 = process.memory_info().rss test_func.test_modify_exif() @@ -37,8 +37,8 @@ def test_memory_leak_when_writing(): test_func.test_modify_comment() test_func.test_modify_icc() memory_end = process.memory_info().rss - delta = (memory_end - memory_1) / 1024 - assert delta < 100, 'Memory grew by {}KB, a memory leak may have occurred.'.format(delta) + delta = (memory_end - memory_1) / 1024 / 1024 + assert delta < 1, 'Memory grew by {}MB, a memory leak may have occurred.'.format(delta) def test_stack_overflow():