summaryrefslogtreecommitdiff
path: root/scripts/Util.py
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2016-12-24 10:11:51 +0100
committerBenoit Foucher <benoit@zeroc.com>2016-12-24 10:11:51 +0100
commit2634a3764932806c34ff1cf4abf4b3b4271634fa (patch)
tree0d96551336726f9f9786bf5b5febc3e61d6b0de7 /scripts/Util.py
parentAnother fix for UWP tests (diff)
downloadice-2634a3764932806c34ff1cf4abf4b3b4271634fa.tar.bz2
ice-2634a3764932806c34ff1cf4abf4b3b4271634fa.tar.xz
ice-2634a3764932806c34ff1cf4abf4b3b4271634fa.zip
Fixed JS Glacier2/router client to no longer ignore failures and fixed Util.py to prevent hangs in case servers didn't shutdown
Diffstat (limited to 'scripts/Util.py')
-rw-r--r--scripts/Util.py23
1 files changed, 12 insertions, 11 deletions
diff --git a/scripts/Util.py b/scripts/Util.py
index 70320c39597..aeab071b54d 100644
--- a/scripts/Util.py
+++ b/scripts/Util.py
@@ -987,7 +987,14 @@ class Process(Runnable):
if not self.quiet and not current.driver.isWorkerThread():
# Print out the process output to stdout if we're running the client form the main thread.
self.process.trace(self.outfilters)
- self.stop(current, True, exitstatus, watchDog)
+ while True:
+ try:
+ self.process.waitSuccess(timeout=30)
+ break
+ except Expect.TIMEOUT:
+ if watchDog and watchDog.timedOut():
+ raise
+ self.stop(current, True, exitstatus)
def getEffectiveArgs(self, current, args):
allArgs = []
@@ -1037,17 +1044,11 @@ class Process(Runnable):
# To be overridden in specialization to wait for a token indicating the process readiness.
pass
- def stop(self, current, waitSuccess=False, exitstatus=0, watchDog=None):
+ def stop(self, current, waitSuccess=False, exitstatus=0):
if self.process:
try:
if waitSuccess: # Wait for the process to exit successfully by itself.
- while True:
- try:
- self.process.waitSuccess(exitstatus=exitstatus, timeout=30)
- break
- except Expect.TIMEOUT:
- if watchDog and watchDog.timedOut():
- raise
+ self.process.waitSuccess(exitstatus=exitstatus, timeout=30)
finally:
self.process.terminate()
self.output = self.process.getOutput()
@@ -1137,8 +1138,8 @@ class Server(IceProcess):
if not self.quiet and not current.driver.isWorkerThread():
self.process.trace(self.outfilters)
- def stop(self, current, waitSuccess=False, exitstatus=0, watchDog=None):
- IceProcess.stop(self, current, waitSuccess and self.waitForShutdown, exitstatus, watchDog)
+ def stop(self, current, waitSuccess=False, exitstatus=0):
+ IceProcess.stop(self, current, waitSuccess and self.waitForShutdown, exitstatus)
#
# An Ice client process.