Skip to content

Commit

Permalink
Merge pull request TechEmpower#1136 from TechEmpower/scorched_earth
Browse files Browse the repository at this point in the history
Fix minor bugs
  • Loading branch information
aschneider-techempower committed Oct 25, 2014
2 parents 178f04c + 7dbe704 commit 9f295a5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion frameworks/Perl/plack/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def start(args, logfile, errfile):
except subprocess.CalledProcessError:
return 1

def stop(logfile, errfile):
def stop(logfile, errfile):
try:
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,
Expand Down
9 changes: 9 additions & 0 deletions toolset/benchmark/benchmarker.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,8 @@ def exit_with_code(code):
time.sleep(5)

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)
time.sleep(5)
if self.__is_port_bound(test.port):
Expand Down Expand Up @@ -692,6 +694,13 @@ def __forciblyEndPortBoundProcesses(self, test_port, out, err):
splitline = line.split()
port = splitline[3].split(':')
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:
try:
pid = splitline[6].split('/')[0].strip()
Expand Down

0 comments on commit 9f295a5

Please sign in to comment.