Browse Source

Turns out these sleeps are required

msmith-techempower 8 years ago
parent
commit
b41c867412
1 changed files with 5 additions and 3 deletions
  1. 5 3
      toolset/benchmark/benchmarker.py

+ 5 - 3
toolset/benchmark/benchmarker.py

@@ -574,6 +574,7 @@ class Benchmarker:
         result, process = test.start(out)
         result, process = test.start(out)
         if result != 0:
         if result != 0:
           self.__stop_test(out, process)
           self.__stop_test(out, process)
+          time.sleep(5)
           out.write( "ERROR: Problem starting {name}\n".format(name=test.name) )
           out.write( "ERROR: Problem starting {name}\n".format(name=test.name) )
           out.flush()
           out.flush()
           self.__write_intermediate_results(test.name,"<setup.py>#start() returned non-zero")
           self.__write_intermediate_results(test.name,"<setup.py>#start() returned non-zero")
@@ -612,11 +613,13 @@ class Benchmarker:
         out.flush()
         out.flush()
         self.__stop_test(out, process)
         self.__stop_test(out, process)
         out.flush()
         out.flush()
+        time.sleep(5)
 
 
         if self.__is_port_bound(test.port):
         if self.__is_port_bound(test.port):
           # This can happen sometimes - let's try again
           # This can happen sometimes - let's try again
           self.__stop_test(out, process)
           self.__stop_test(out, process)
           out.flush()
           out.flush()
+          time.sleep(5)
           if self.__is_port_bound(test.port):
           if self.__is_port_bound(test.port):
             # We gave it our all
             # We gave it our all
             self.__write_intermediate_results(test.name, "port " + str(test.port) + " was not released by stop")
             self.__write_intermediate_results(test.name, "port " + str(test.port) + " was not released by stop")
@@ -688,17 +691,16 @@ class Benchmarker:
   ############################################################
   ############################################################
   def __stop_test(self, out, process):
   def __stop_test(self, out, process):
     if process is not None and process.poll() is None:
     if process is not None and process.poll() is None:
-      # Stop the ancestry PIDs so they don't fork anymore.
+      # Stop 
       pids = self.__find_child_processes(process.pid)
       pids = self.__find_child_processes(process.pid)
       if pids is not None:
       if pids is not None:
         stop = ['kill', '-STOP'] + pids
         stop = ['kill', '-STOP'] + pids
         subprocess.call(stop, stderr=out, stdout=out)
         subprocess.call(stop, stderr=out, stdout=out)
-      # Kill the ancestry PIDs.
       pids = self.__find_child_processes(process.pid)
       pids = self.__find_child_processes(process.pid)
       if pids is not None:
       if pids is not None:
         term = ['kill', '-TERM'] + pids
         term = ['kill', '-TERM'] + pids
         subprocess.call(term, stderr=out, stdout=out)
         subprocess.call(term, stderr=out, stdout=out)
-      # Okay, if there are any more PIDs, kill them harder.
+      # Okay, if there are any more PIDs, kill them harder
       pids = self.__find_child_processes(process.pid)
       pids = self.__find_child_processes(process.pid)
       if pids is not None:
       if pids is not None:
         kill = ['kill', '-KILL'] + pids
         kill = ['kill', '-KILL'] + pids