Skip to content

Commit 9b5bfa2

Browse files
committed
Tweak CPU utilization check in test_parallel_leiden_performance
1 parent ab94be2 commit 9b5bfa2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

tests/test_parallel_leiden_performance.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ def determine_target_parallelization_speedup(num_calculations=32):
3838
"""
3939
global PERFORMANCE_TARGET_RELATIVE_TO_PERFECT_SCALING
4040

41-
sleep(5) # sleep to increase stability of the CPU utilization check
42-
cpu_utilization = psutil.cpu_percent()
41+
cpu_utilization = psutil.cpu_percent(interval=5)
4342
if cpu_utilization > 20:
4443
PERFORMANCE_TARGET_RELATIVE_TO_PERFECT_SCALING = 0.5
4544
warnings.warn(f"System CPU utilization is non-negligible during parallel performance test! "

0 commit comments

Comments
 (0)