summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-04-13 06:34:59 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-04-13 06:34:59 (GMT)
commit07c60717296ab8228b4a4e46d5e6fb163965a181 (patch)
treebdb42e37d12b4a8e15c25e4ab5e4a44c53d8c606
parent412fb673685168751b193ca6a13ea90825f8b314 (diff)
downloadcpython-07c60717296ab8228b4a4e46d5e6fb163965a181.zip
cpython-07c60717296ab8228b4a4e46d5e6fb163965a181.tar.gz
cpython-07c60717296ab8228b4a4e46d5e6fb163965a181.tar.bz2
test_compile can be really long if we are using -u compiler.
This may be causing the debian sparc buildbot to fail. Print a little message to let the user ^w buildbot know it's still thinking. We may want to adjust the time period which is currently 5 minutes. Will backport.
-rw-r--r--Lib/test/test_compiler.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/Lib/test/test_compiler.py b/Lib/test/test_compiler.py
index 5e7b15c..a59d6aa 100644
--- a/Lib/test/test_compiler.py
+++ b/Lib/test/test_compiler.py
@@ -1,10 +1,12 @@
import compiler
from compiler.ast import flatten
-import os
+import os, sys, time, unittest
import test.test_support
-import unittest
from random import random
+# How much time in seconds can pass before we print a 'Still working' message.
+_PRINT_WORKING_MSG_INTERVAL = 5 * 60
+
class CompilerTest(unittest.TestCase):
def testCompileLibrary(self):
@@ -13,11 +15,18 @@ class CompilerTest(unittest.TestCase):
# that any of the code is correct, merely the compiler is able
# to generate some kind of code for it.
+ next_time = time.time() + _PRINT_WORKING_MSG_INTERVAL
libdir = os.path.dirname(unittest.__file__)
testdir = os.path.dirname(test.test_support.__file__)
for dir in [libdir, testdir]:
for basename in os.listdir(dir):
+ # Print still working message since this test can be really slow
+ if next_time <= time.time():
+ next_time = time.time() + _PRINT_WORKING_MSG_INTERVAL
+ print >>sys.__stdout__, \
+ ' testCompileLibrary still working, be patient...'
+
if not basename.endswith(".py"):
continue
if not TEST_ALL and random() < 0.98: