Browse Source

Merge pull request #1136 from TechEmpower/scorched_earth

Fix minor bugs
Alexander Schneider 10 years ago
parent
commit
9f295a56a4
2 changed files with 10 additions and 1 deletions
  1. 1 1
      frameworks/Perl/plack/setup.py
  2. 9 0
      toolset/benchmark/benchmarker.py

+ 1 - 1
frameworks/Perl/plack/setup.py

@@ -16,7 +16,7 @@ def start(args, logfile, errfile):
   except subprocess.CalledProcessError:
   except subprocess.CalledProcessError:
     return 1
     return 1
 
 
- def stop(logfile, errfile):
+def stop(logfile, errfile):
    try:
    try:
      subprocess.Popen("kill -TERM $(ps --ppid `cat app.pid` -o pid --no-header)", shell=True, cwd="plack", stderr=errfile, stdout=logfile)
      subprocess.Popen("kill -TERM $(ps --ppid `cat app.pid` -o pid --no-header)", shell=True, cwd="plack", stderr=errfile, stdout=logfile)
      # TE - There was an issue on the EC2 machines where this, for reasons unknown,
      # TE - There was an issue on the EC2 machines where this, for reasons unknown,

+ 9 - 0
toolset/benchmark/benchmarker.py

@@ -591,6 +591,8 @@ class Benchmarker:
         time.sleep(5)
         time.sleep(5)
 
 
         if self.__is_port_bound(test.port):
         if self.__is_port_bound(test.port):
+          err.write("Port %s was not freed. Attempting to free it." % (test.port, ))
+          err.flush()
           self.__forciblyEndPortBoundProcesses(test.port, out, err)
           self.__forciblyEndPortBoundProcesses(test.port, out, err)
           time.sleep(5)
           time.sleep(5)
           if self.__is_port_bound(test.port):
           if self.__is_port_bound(test.port):
@@ -692,6 +694,13 @@ class Benchmarker:
         splitline = line.split()
         splitline = line.split()
         port = splitline[3].split(':')
         port = splitline[3].split(':')
         port = int(port[len(port) - 1].strip())
         port = int(port[len(port) - 1].strip())
+        if port > 6000:
+          err.write(textwrap.dedent(
+        """
+        A port that shouldn't be open is open. See the following line for netstat output.
+        {splitline}
+        """.format(splitline=splitline)))
+          err.flush()
         if port == test_port:
         if port == test_port:
           try:
           try:
             pid = splitline[6].split('/')[0].strip()
             pid = splitline[6].split('/')[0].strip()