Skip to content
Snippets Groups Projects
Commit 48cbf2cf authored by Daniel Brown's avatar Daniel Brown
Browse files

watcher thread now start the test thread when ready, stops the watcher trying...

watcher thread now start the test thread when ready, stops the watcher trying to join the test thread before it is ready
parent 0ce64fb3
No related branches found
No related tags found
No related merge requests found
......@@ -39,6 +39,7 @@ class FinesseProcessWatcher(Thread):
self.process_to_watch = process
def run(self):
try:
global schedule_lock,current_test,scheduled_tests, watcher
if self.process_to_watch is None:
......@@ -48,11 +49,11 @@ class FinesseProcessWatcher(Thread):
# raise Exception("Tried to watch something which wasn't a FinesseTestProcess")
print "Watcher is watching", self.process_to_watch
self.process_to_watch.start()
self.process_to_watch.join()
print "Watcher is continuing"
try:
# once done check if any other tests need to be ran
schedule_lock.acquire()
......@@ -62,13 +63,14 @@ class FinesseProcessWatcher(Thread):
watcher = FinesseProcessWatcher()
watcher.setProcessToWatch(current_test)
watcher.start()
current_test.start()
else:
print "Watcher found no more tests to run"
current_test = None
watcher = None
finally:
schedule_lock.release()
@app.route('/finesse/cancel_test_<id>', methods=["POST"])
def finesse_cancel_test(id):
print id
......@@ -150,12 +152,11 @@ def finesse_start_test():
if current_test is None:
print "running test"
current_test = test
# create watcher thread which will start the test
# when ready
watcher = FinesseProcessWatcher()
watcher.setProcessToWatch(test)
watcher.start()
test.start()
else:
print "queuing test"
scheduled_tests.append(test)
......
......@@ -11,7 +11,7 @@ REQUIREMENTS = [i.strip() for i in open("requirements.txt").readlines()]
setup(
name='PyKat',
version='0.0.2',
version='0.0.3',
author='Daniel Brown',
author_email='ddb@star.sr.bham.ac.uk',
packages=['pykat','pykat.gui','pykat.gui.resources'],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment