From ad5b57beacd2669864197d6ca2f013a2bfc8fd02 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Fri, 1 Sep 2023 10:41:17 -0700 Subject: [PATCH 1/2] When -Xuops is given, pass it along to subprocess in run_python in test_regrtest.py --- Lib/test/test_regrtest.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py index 806b932a164df8..14972b83a9f92b 100644 --- a/Lib/test/test_regrtest.py +++ b/Lib/test/test_regrtest.py @@ -548,7 +548,11 @@ def run_command(self, args, input=None, exitcode=0, **kw): return proc def run_python(self, args, **kw): - args = [sys.executable, '-X', 'faulthandler', '-I', *args] + extraargs = [] + if 'uops' in sys._xoptions: + # Pass -X uops along + extraargs.extend(['-X', 'uops']) + args = [sys.executable, *extraargs, '-X', 'faulthandler', '-I', *args] proc = self.run_command(args, **kw) return proc.stdout From da76e31feeb03adc48ade709322b5389215c4858 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Fri, 1 Sep 2023 11:01:41 -0700 Subject: [PATCH 2/2] Use more repetitions in test_huntrleaks --- Lib/test/test_regrtest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py index 14972b83a9f92b..0c1400c8105037 100644 --- a/Lib/test/test_regrtest.py +++ b/Lib/test/test_regrtest.py @@ -897,12 +897,12 @@ def check_leak(self, code, what): filename = 'reflog.txt' self.addCleanup(os_helper.unlink, filename) - output = self.run_tests('--huntrleaks', '3:3:', test, + output = self.run_tests('--huntrleaks', '6:3:', test, exitcode=EXITCODE_BAD_TEST, stderr=subprocess.STDOUT) self.check_executed_tests(output, [test], failed=test) - line = 'beginning 6 repetitions\n123456\n......\n' + line = 'beginning 9 repetitions\n123456789\n.........\n' self.check_line(output, re.escape(line)) line2 = '%s leaked [1, 1, 1] %s, sum=3\n' % (test, what)