Browse Source

Print some output if start takes a very long time

Hamilton Turner 11 years ago
parent
commit
3bccf01260
1 changed files with 21 additions and 0 deletions
  1. 21 0
      toolset/benchmark/framework_test.py

+ 21 - 0
toolset/benchmark/framework_test.py

@@ -14,6 +14,8 @@ import logging
 import csv
 import shlex
 import math
+from threading import Thread
+from threading import Event
 
 from utils import header
 
@@ -451,6 +453,20 @@ class FrameworkTest:
               command='export TROOT=%s && export IROOT=%s' %
               (self.directory, self.install_root))
 
+    # Because start can take so long, we print a dot to let the user know 
+    # we are working
+    class ProgressPrinterThread(Thread):
+      def __init__(self, event):
+          Thread.__init__(self)
+          self.stopped = event
+
+      def run(self):
+        while not self.stopped.wait(20):
+          sys.stderr.write("Waiting for start to return...\n")
+    stopFlag = Event()
+    thread = ProgressPrinterThread(stopFlag)
+    thread.start()
+
     # Run the module start (inside parent of TROOT)
     #     - we use the parent as a historical accident - a lot of tests
     #       use subprocess's cwd argument already
@@ -460,6 +476,11 @@ class FrameworkTest:
     retcode = self.setup_module.start(self, out, err)    
     os.chdir(previousDir)
 
+    # Stop the progress printer
+    stopFlag.set()
+
+    logging.info("Start completed, running %s", self.benchmarker.mode)
+
     return retcode
   ############################################################
   # End start