summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-09-26 01:05:07 (GMT)
committerGitHub <noreply@github.com>2023-09-26 01:05:07 (GMT)
commit4091deba88946841044b0a54090492a2fd903d42 (patch)
tree2c6d7a7076995fd5e066950b3c2d326bbd5e7183 /Lib
parente5186c3de4194de3ea8c80edb182d786f5e20944 (diff)
downloadcpython-4091deba88946841044b0a54090492a2fd903d42.zip
cpython-4091deba88946841044b0a54090492a2fd903d42.tar.gz
cpython-4091deba88946841044b0a54090492a2fd903d42.tar.bz2
gh-109739: regrtest disables load tracker if refleak (#109871)
regrtest: Fix reference leak check on Windows. Disable the load tracker on Windows in the reference leak check mode (-R option).
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/libregrtest/main.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/Lib/test/libregrtest/main.py b/Lib/test/libregrtest/main.py
index a9dd087..0ec25a0 100644
--- a/Lib/test/libregrtest/main.py
+++ b/Lib/test/libregrtest/main.py
@@ -20,7 +20,8 @@ from .utils import (
StrPath, StrJSON, TestName, TestList, TestTuple, FilterTuple,
strip_py_suffix, count, format_duration,
printlist, get_temp_dir, get_work_dir, exit_timeout,
- display_header, cleanup_temp_dir)
+ display_header, cleanup_temp_dir,
+ MS_WINDOWS)
class Regrtest:
@@ -435,7 +436,15 @@ class Regrtest:
setup_process()
- self.logger.start_load_tracker()
+ if self.hunt_refleak and not self.num_workers:
+ # gh-109739: WindowsLoadTracker thread interfers with refleak check
+ use_load_tracker = False
+ else:
+ # WindowsLoadTracker is only needed on Windows
+ use_load_tracker = MS_WINDOWS
+
+ if use_load_tracker:
+ self.logger.start_load_tracker()
try:
if self.num_workers:
self._run_tests_mp(runtests, self.num_workers)
@@ -448,7 +457,8 @@ class Regrtest:
if self.want_rerun and self.results.need_rerun():
self.rerun_failed_tests(runtests)
finally:
- self.logger.stop_load_tracker()
+ if use_load_tracker:
+ self.logger.stop_load_tracker()
self.display_summary()
self.finalize_tests(tracer)