From 677eff9f2428afe436f2e46cd585f56955cb5719 Mon Sep 17 00:00:00 2001 From: Pablo Galindo Date: Sat, 16 Jun 2018 00:07:14 +0100 Subject: [PATCH 1/4] Add warning when using less than 3 warmup runs in `runtest.py`. --- Lib/test/libregrtest/runtest.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Lib/test/libregrtest/runtest.py b/Lib/test/libregrtest/runtest.py index 12bf422c902dc1..b8111981751109 100644 --- a/Lib/test/libregrtest/runtest.py +++ b/Lib/test/libregrtest/runtest.py @@ -98,6 +98,13 @@ def runtest(ns, test): output_on_failure = ns.verbose3 + if ns.huntrleaks: + warmup, repetitions, _ = ns.huntrleaks + if warmup < 3: + msg = ("WARNING: Using less than 3 warmup repetitions can " + "give false positives!") + print(msg, file=sys.stdout, flush=True) + use_timeout = (ns.timeout is not None) if use_timeout: faulthandler.dump_traceback_later(ns.timeout, exit=True) From cc7e0deff076b2fbee852be92009d5dfdbab11da Mon Sep 17 00:00:00 2001 From: Pablo Galindo Date: Sat, 16 Jun 2018 00:28:37 +0100 Subject: [PATCH 2/4] Move warning to Regrtest.run_test. --- Lib/test/libregrtest/main.py | 7 +++++++ Lib/test/libregrtest/runtest.py | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Lib/test/libregrtest/main.py b/Lib/test/libregrtest/main.py index 3429b3726abe90..274cf7166e4f34 100644 --- a/Lib/test/libregrtest/main.py +++ b/Lib/test/libregrtest/main.py @@ -462,6 +462,13 @@ def run_tests(self): or self.tests or self.ns.args)): self.display_header() + if self.ns.huntrleaks: + warmup, repetitions, _ = self.ns.huntrleaks + if warmup < 3: + msg = ("WARNING: Using less than 3 warmup repetitions can " + "give false positives!") + print(msg, file=sys.stdout, flush=True) + if self.ns.randomize: print("Using random seed", self.ns.random_seed) diff --git a/Lib/test/libregrtest/runtest.py b/Lib/test/libregrtest/runtest.py index b8111981751109..12bf422c902dc1 100644 --- a/Lib/test/libregrtest/runtest.py +++ b/Lib/test/libregrtest/runtest.py @@ -98,13 +98,6 @@ def runtest(ns, test): output_on_failure = ns.verbose3 - if ns.huntrleaks: - warmup, repetitions, _ = ns.huntrleaks - if warmup < 3: - msg = ("WARNING: Using less than 3 warmup repetitions can " - "give false positives!") - print(msg, file=sys.stdout, flush=True) - use_timeout = (ns.timeout is not None) if use_timeout: faulthandler.dump_traceback_later(ns.timeout, exit=True) From d18f1436a9ab675625b3f2923b6e5bcd39207f86 Mon Sep 17 00:00:00 2001 From: Pablo Galindo Date: Sat, 16 Jun 2018 00:29:40 +0100 Subject: [PATCH 3/4] Mention --huntrleaks/-R in the warning message --- Lib/test/libregrtest/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/test/libregrtest/main.py b/Lib/test/libregrtest/main.py index 274cf7166e4f34..96040a67274620 100644 --- a/Lib/test/libregrtest/main.py +++ b/Lib/test/libregrtest/main.py @@ -465,8 +465,8 @@ def run_tests(self): if self.ns.huntrleaks: warmup, repetitions, _ = self.ns.huntrleaks if warmup < 3: - msg = ("WARNING: Using less than 3 warmup repetitions can " - "give false positives!") + msg = ("WARNING: Runing tests with --huntrleaks/-R and less than " + "3 warmup repetitions can give false positives!") print(msg, file=sys.stdout, flush=True) if self.ns.randomize: From 1696a14cc030c61987b9d3e355e67fef34c8a2ab Mon Sep 17 00:00:00 2001 From: Pablo Galindo Date: Sat, 16 Jun 2018 01:08:52 +0100 Subject: [PATCH 4/4] fixup! Mention --huntrleaks/-R in the warning message --- Lib/test/libregrtest/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/libregrtest/main.py b/Lib/test/libregrtest/main.py index 96040a67274620..569d034af1a338 100644 --- a/Lib/test/libregrtest/main.py +++ b/Lib/test/libregrtest/main.py @@ -465,7 +465,7 @@ def run_tests(self): if self.ns.huntrleaks: warmup, repetitions, _ = self.ns.huntrleaks if warmup < 3: - msg = ("WARNING: Runing tests with --huntrleaks/-R and less than " + msg = ("WARNING: Running tests with --huntrleaks/-R and less than " "3 warmup repetitions can give false positives!") print(msg, file=sys.stdout, flush=True)