[Python-checkins] cpython (merge default -> default): Merge.

charles-francois.natali python-checkins at python.org
Fri Jun 3 13:00:08 CEST 2011


http://hg.python.org/cpython/rev/def3843bfd52
changeset:   70613:def3843bfd52
parent:      70612:277bbe6cae53
parent:      70611:f69a2716d433
user:        Charles-François Natali <neologix at free.fr>
date:        Fri Jun 03 12:57:49 2011 +0200
summary:
  Merge.

files:
  Lib/test/regrtest.py |  16 +++++++---------
  Makefile.pre.in      |   2 +-
  2 files changed, 8 insertions(+), 10 deletions(-)


diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -22,8 +22,7 @@
 -h/--help       -- print this text and exit
 --timeout TIMEOUT
                 -- dump the traceback and exit if a test takes more
-                   than TIMEOUT seconds (default: 30 minutes); disable
-                   the timeout if TIMEOUT is zero
+                   than TIMEOUT seconds
 --wait          -- wait for user input, e.g., allow a debugger to be attached
 
 Verbosity
@@ -269,11 +268,6 @@
     # Display the Python traceback fatal errors (e.g. segfault)
     faulthandler.enable(all_threads=True)
 
-    if hasattr(faulthandler, 'dump_tracebacks_later'):
-        timeout = 60*60
-    else:
-        timeout = None
-
     replace_stdout()
 
     support.record_original_stdout(sys.stdout)
@@ -295,6 +289,7 @@
         use_resources = []
     debug = False
     start = None
+    timeout = None
     for o, a in opts:
         if o in ('-h', '--help'):
             print(__doc__)
@@ -420,10 +415,13 @@
             testdir = os.path.join(support.SAVEDCWD, a)
         elif o == '--timeout':
             if not hasattr(faulthandler, 'dump_tracebacks_later'):
-                print("--timeout option requires "
+                print("The timeout option requires "
                       "faulthandler.dump_tracebacks_later", file=sys.stderr)
                 sys.exit(1)
             timeout = float(a)
+            if timeout <= 0:
+                print("The timeout must be greater than 0", file=sys.stderr)
+                sys.exit(1)
         elif o == '--wait':
             input("Press any key to continue...")
         else:
@@ -835,7 +833,7 @@
     support.verbose = verbose  # Tell tests to be moderately quiet
     if use_resources is not None:
         support.use_resources = use_resources
-    use_timeout = (timeout is not None and timeout > 0)
+    use_timeout = (timeout is not None)
     if use_timeout:
         faulthandler.dump_tracebacks_later(timeout, exit=True)
     try:
diff --git a/Makefile.pre.in b/Makefile.pre.in
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -755,7 +755,7 @@
 # generated bytecode.  This is sometimes a very shy bug needing a lot of
 # sample data.
 
-TESTOPTS=	-l $(EXTRATESTOPTS)
+TESTOPTS=	-l --timeout=3600 $(EXTRATESTOPTS)
 TESTPROG=	$(srcdir)/Lib/test/regrtest.py
 TESTPYTHON=	$(RUNSHARED) ./$(BUILDPYTHON) -Wd -E -bb $(TESTPYTHONOPTS)
 test:		all platform

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list