Tools: Fix closing a perf server

This commit is contained in:
Jeffrey Pfau 2016-03-05 18:11:00 -08:00
parent b1691c9527
commit 9d0865d5d4
1 changed files with 9 additions and 5 deletions

View File

@ -103,13 +103,16 @@ class PerfServer(object):
self.results.append(next(self.reader))
self.iterations -= 1
if self.iterations == 0:
self.socket.send("\n");
self.reader = None
self.socket.close()
time.sleep(5)
self.socket = None
self.finish()
self.iterations = self.ITERATIONS_PER_INSTANCE
def finish(self):
self.socket.send("\n");
self.reader = None
self.socket.close()
time.sleep(5)
self.socket = None
class Suite(object):
def __init__(self, cwd, wall=None, game=None, renderer='software'):
self.cwd = cwd
@ -153,6 +156,7 @@ class Suite(object):
if test.results:
results.append(test.results)
if self.server:
self.server.finish()
results.extend(self.server.results)
return results