summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Rohdewald <wolfgang@rohdewald.de>2015-12-01 04:58:37 (GMT)
committerWolfgang Rohdewald <wolfgang@rohdewald.de>2016-08-24 10:26:51 (GMT)
commitb2de9da27a44cf752ff48dee9bab12d3a042fe2a (patch)
treed5e6753a5771241946af3f810c9618cd2a9bbb21
parentc8083ffb2eb628021a7abcceb9ce16b97d98dd5c (diff)
kajonggtest can now allocate more than one server per commit
-rwxr-xr-xsrc/kajonggtest.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/kajonggtest.py b/src/kajonggtest.py
index 58e9c7e..7f1196b 100755
--- a/src/kajonggtest.py
+++ b/src/kajonggtest.py
@@ -127,8 +127,10 @@ class Server(StrMixin):
running = Server.allRunningJobs()
if len(running) >= OPTIONS.clients:
raise TooManyClients
+ maxClientsPerServer = OPTIONS.clients / OPTIONS.servers
matchingServers = list(
- x for x in cls.servers if x.commitId == job.commitId)
+ x for x in cls.servers
+ if x.commitId == job.commitId and len(x.jobs) < maxClientsPerServer)
if matchingServers:
result = sorted(matchingServers, key=lambda x: len(x.jobs))[0]
else:
@@ -511,7 +513,7 @@ def startingDir():
def getJobs(jobs):
"""fill the queue"""
try:
- while len(jobs) < OPTIONS.servers * OPTIONS.clients:
+ while len(jobs) < OPTIONS.clients:
jobs.append(next(OPTIONS.jobs))
except StopIteration:
pass