Skip to content

Commit

Permalink
working to reenable system tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Romain Slootmaekers committed May 26, 2011
1 parent 593d733 commit 32bce49
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion buildInSandbox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -e


ocamlbuild $@ arakoon.native
ocamlbuild $@ -use-ocamlfind arakoon.native

mkdir -p /opt/qbase3/apps/arakoon/bin/
cp arakoon.native /opt/qbase3/apps/arakoon/bin/arakoon
Expand Down
16 changes: 11 additions & 5 deletions extension/server/ArakoonManagement.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ def _set(s,a,v):

self.__validateName(name)
if not name in nodes:
raise Exception("No node with name %s configured in cluster %s" % (name,self._clusterId))
raise Exception("No node with name %s configured in cluster %s" % (name,self._clusterId) )
_set(g,m,name)
if preferred:
_set(g,pm,'true')
Expand Down Expand Up @@ -544,7 +544,7 @@ def removeLocalNode(self, name):
node_str = ','.join(nodes)
config.setParam("global","cluster", node_str)
config.write()

def listLocalNodes(self):
"""
Get a list of the local nodes in the supplied cluster
Expand Down Expand Up @@ -741,7 +741,7 @@ def remoteCollapse(self, nodeName, n):
"""
Tell the targetted node to collapse n tlog files
@type nodeName: string
@type n: int > 0
@type n: int
"""
config = self.getNodeConfig(nodeName)
ip = config['ip']
Expand Down Expand Up @@ -806,12 +806,18 @@ def _stopOne(self, name):
while(self._getStatusOne(name) == q.enumerators.AppStatusType.RUNNING):
time.sleep(1)
i += 1
logging.debug("'%s' is still running... waiting" % name)
q.logger.log("'%s' is still running... waiting" % name, level = 3)

if i == 10:
logging.debug("stopping '%s' with -9")
logging.debug("stopping '%s' with kill -9" % name)
q.logger.log("stopping '%s' with kill -9" % name, level = 3)
subprocess.call(['pkill', '-9', '-fx', line], close_fds=True)
cnt = 0
while (self._getStatusOne(name, cluster = cluster) == q.enumerators.AppStatusType.RUNNING ) :
while (self._getStatusOne(name) == q.enumerators.AppStatusType.RUNNING ) :
logging.debug("'%s' is STILL running... waiting" % name)
q.logger.log("'%s' is STILL running... waiting" % name,
level = 3)
time.sleep(1)
cnt += 1
if( cnt > 10):
Expand Down
10 changes: 5 additions & 5 deletions extension/server/ArakoonRemoteControl.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,17 @@ def collapse(ip, port, clusterId, n):
"""
tell the node listening on (ip, port) to collapse, and keep n tlog files
@type ip: string
@type port: int > 0
@type n: int
@type port: int
@type n: int > 0
@type clusterId:string
@param clusterId: must match cluster id of the node
"""
if n < 1:
raise ValueError("n < 1 is not acceptible")

if n < 1:
raise ValueError("%i is not acceptable" % n)
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sa = (ip, port)
s.connect(sa)

try:
_prologue(clusterId, s)
cmd = _int_to(_COLLAPSE_TLOGS | _MAGIC)
Expand Down

0 comments on commit 32bce49

Please sign in to comment.