From 9d8bc3a8fe9ffc6514240c9baff7ee2aae286ac5 Mon Sep 17 00:00:00 2001
From: Daniel Brown <ddb@star.sr.bham.ac.uk>
Date: Sat, 17 Aug 2013 19:26:34 +0100
Subject: [PATCH] turns out that some FinesseTestProcess members were static
 and were shared across multiple processes, like the run time data for the kat
 files and exception data. This has been initialised properly now

---
 pykat/testing/test.py              | 17 ++++++++++++-----
 pykat/testing/web/web_interface.py |  9 +++++++--
 2 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/pykat/testing/test.py b/pykat/testing/test.py
index 8c73414..9291ab3 100644
--- a/pykat/testing/test.py
+++ b/pykat/testing/test.py
@@ -39,12 +39,7 @@ class FinesseTestProcess(Thread):
     errorOccurred = None
     diffFound = False
     diffing = False
-    kats_to_run = []
     
-    # Define storage structures for generating report later
-    kat_run_exceptions = {}
-    output_differences = {}
-    run_times = {}
         
     def __init__(self, TEST_DIR, BASE_DIR, test_commit, 
                  run_fast=False, kats=[], test_id="0",
@@ -56,6 +51,10 @@ class FinesseTestProcess(Thread):
         if test_commit is None:
             raise Exception("A git commit ID must be provided for the test")
         
+        self.kat_run_exceptions = {}
+        self.output_differences = {}
+        self.run_times = {}
+        
         self.queue_time = datetime.now()
         self.test_id = test_id
         self.TEST_DIR = TEST_DIR
@@ -95,6 +94,12 @@ class FinesseTestProcess(Thread):
             
         self.kats_to_run = kats
         
+        print "KATS TO TEST"
+        
+        for a in kats.keys():
+            for kat in kats[a]:
+                print "INIT!!!!",a,kat
+        
         self.GIT_BIN = git_bin
     
     def cancelCheck(self):
@@ -227,6 +232,8 @@ class FinesseTestProcess(Thread):
         # create dictionary structures
         # and count up total number of files to process
         for suite in self.kats_to_run.keys():
+            print "RUNNING SUITES", suite
+            
             self.kat_run_exceptions[suite] = {}
             self.output_differences[suite] = {}
             self.run_times[suite] = {}
diff --git a/pykat/testing/web/web_interface.py b/pykat/testing/web/web_interface.py
index 9ac6fdc..f5308d2 100644
--- a/pykat/testing/web/web_interface.py
+++ b/pykat/testing/web/web_interface.py
@@ -134,8 +134,9 @@ class FinesseProcessWatcher(Thread):
             
             if self.process_to_watch is not None:
                 for suite in self.process_to_watch.run_times.keys():
-                    
                     for kat in self.process_to_watch.run_times[suite].keys(): 
+                        print "!!!!KAT - ",suite, kat
+                    
                         key = str(suite) + "_" + str(kat)
                         out = kat.replace(".kat",".out")
                         
@@ -275,7 +276,7 @@ def finesse_cancel_test(id):
                 try:
                     #need to update in database for queued test
                     doc = db.get("testid",id,with_doc=True)["doc"]
-                    doc["cancelled"] = true
+                    doc["cancelled"] = True
                     db.update(doc)
                 except RecordNotFound:
                     pass
@@ -350,6 +351,10 @@ def finesse_start_test():
     
 def __finesse_start_test(git_commit, kats, nobuild=False):
     
+    for a in kats.keys():
+        for b in kats[a]:
+            print "START KAT",a,b
+            
     global current_test, test_id
     
     git_commits = []
-- 
GitLab