summaryrefslogtreecommitdiff
path: root/scripts/LocalDriver.py
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2017-06-20 12:38:43 +0200
committerBenoit Foucher <benoit@zeroc.com>2017-06-20 12:38:43 +0200
commit89fcb61132c73afa2f808c54d6406f0073d8735a (patch)
tree498e3113020a668a51a0f782fe342db091713335 /scripts/LocalDriver.py
parentPrint unexpected exceptions on C# Ice/dispatcher (diff)
downloadice-89fcb61132c73afa2f808c54d6406f0073d8735a.tar.bz2
ice-89fcb61132c73afa2f808c54d6406f0073d8735a.tar.xz
ice-89fcb61132c73afa2f808c54d6406f0073d8735a.zip
No longer kill tests on timeout
Diffstat (limited to 'scripts/LocalDriver.py')
-rw-r--r--scripts/LocalDriver.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/scripts/LocalDriver.py b/scripts/LocalDriver.py
index cad6c5ee81a..334b32391e9 100644
--- a/scripts/LocalDriver.py
+++ b/scripts/LocalDriver.py
@@ -22,6 +22,7 @@ class Executor:
self.mainThreadQueue = []
self.queueLength = 0
self.failure = False
+ self.interrupted = False
self.continueOnFailure = continueOnFailure
self.lock = threading.Lock()
@@ -56,6 +57,10 @@ class Executor:
self.queueLength -= 1
return (queue.pop(0), total - self.queueLength)
+ def isInterrupted(self):
+ with self.lock:
+ return self.interrupted
+
def runTestSuites(self, driver, total, results, mainThread=False):
while True:
item = self.get(total, mainThread)
@@ -139,6 +144,7 @@ class Executor:
except KeyboardInterrupt:
with self.lock:
self.failure = True
+ self.interrupted = True
if threads:
print("Terminating (waiting for worker threads to terminate)...")
raise
@@ -354,6 +360,7 @@ class LocalDriver(Driver):
self.results = []
self.threadlocal = threading.local()
self.loopCount = 1
+ self.executor = Executor(self.threadlocal, self.workers, self.continueOnFailure)
def run(self, mappings, testSuiteIds):
@@ -364,7 +371,6 @@ class LocalDriver(Driver):
self.runner = TestCaseRunner()
while True:
- executor = Executor(self.threadlocal, self.workers, self.continueOnFailure)
for mapping in mappings:
testsuites = self.runner.getTestSuites(mapping, testSuiteIds)
@@ -391,14 +397,14 @@ class LocalDriver(Driver):
continue
elif isinstance(self.runner, RemoteTestCaseRunner) and not testsuite.isMultiHost():
continue
- executor.submit(testsuite, Mapping.getAll() if self.allCross else [self.cross], self)
+ self.executor.submit(testsuite, Mapping.getAll() if self.allCross else [self.cross], self)
#
# Run all the tests and wait for the executor to complete.
#
now = time.time()
- results = executor.runUntilCompleted(self, self.start)
+ results = self.executor.runUntilCompleted(self, self.start)
Expect.cleanup() # Cleanup processes which might still be around
@@ -540,6 +546,9 @@ class LocalDriver(Driver):
def isWorkerThread(self):
return hasattr(self.threadlocal, "num")
+ def isInterrupted(self):
+ return self.executor.isInterrupted()
+
def getTestPort(self, portnum):
# Return a port number in the range 14100-14199 for the first thread, 14200-14299 for the
# second thread, etc.