Skip to content

Commit

Permalink
Added play-activate-mysql
Browse files Browse the repository at this point in the history
Fixed a bug where the process would not successfully terminate
reliably after completing the tests.
  • Loading branch information
tfb committed Oct 29, 2013
1 parent 5490a18 commit 9226b5f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
3 changes: 1 addition & 2 deletions play-activate-mysql/benchmark_config
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
"database_os": "Linux",
"display_name": "play-scala-activate",
"notes": "",
"versus": "netty",
"skip": "true"
"versus": "netty"
}
}]
}
15 changes: 9 additions & 6 deletions play-activate-mysql/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,19 @@ def stop():
pid = int(f.read())
os.kill(pid, 9)
else:
p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
out, err = p.communicate()
for line in out.splitlines():
if 'NettyServer' in line:
pid = int(line.split(None, 2)[1])
os.kill(pid, 9)
kill_running_process()

try:
os.remove("play-activate-mysql/target/universal/play-activate-mysql-1.0-SNAPSHOT/RUNNING_PID")
except OSError:
pass

return 0

def kill_running_process():
try:
with open("./play-activate-mysql/target/universal/play-activate-mysql-1.0-SNAPSHOT/RUNNING_PID") as f:
pid = int(f.read())
os.kill(pid,9)
except:
pass

0 comments on commit 9226b5f

Please sign in to comment.