https://github.com/python/cpython/commit/4e3ead92ca19d0b4327bb12500e2da1755ef809c
commit: 4e3ead92ca19d0b4327bb12500e2da1755ef809c
branch: main
author: Victor Stinner <[email protected]>
committer: vstinner <[email protected]>
date: 2026-05-22T22:26:15+02:00
summary:
gh-150114: Log the memory usage in regrtest in sequential mode (#150264)
files:
M Lib/test/libregrtest/main.py
diff --git a/Lib/test/libregrtest/main.py b/Lib/test/libregrtest/main.py
index ac82541059cc62..8773e9df73263b 100644
--- a/Lib/test/libregrtest/main.py
+++ b/Lib/test/libregrtest/main.py
@@ -27,7 +27,7 @@
printlist, get_temp_dir, get_work_dir, exit_timeout,
display_header, cleanup_temp_dir, print_warning,
is_cross_compiled, get_host_runner, display_title,
- EXIT_TIMEOUT)
+ get_process_memory_usage, EXIT_TIMEOUT)
class Regrtest:
@@ -393,7 +393,12 @@ def run_test(
return result
+ def _get_mem_usage(self):
+ return get_process_memory_usage(os.getpid())
+
def run_tests_sequentially(self, runtests: RunTests) -> None:
+ if not self.pgo:
+ self.logger.get_mem_usage = self._get_mem_usage
if self.coverage:
tracer = trace.Trace(trace=False, count=True)
else:
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]