Siddharth Agarwal avatar Siddharth Agarwal committed 4a41735

run-tests: remove resultslock since it serves no useful purpose

Each child process has its own copy of the results dict, so all access to the results dict is serial.

Comments (0)

Files changed (1)

tests/run-tests.py

     True -> passed
     False -> failed'''
 
-    global results, resultslock, iolock
+    global results, iolock
 
     testpath = os.path.join(TESTDIR, test)
 
-    def result(l, e):
-        resultslock.acquire()
-        results[l].append(e)
-        resultslock.release()
-
     def skip(msg):
         if not options.verbose:
-            result('s', (test, msg))
+            results['s'].append((test, msg))
         else:
             iolock.acquire()
             print "\nSkipping %s: %s" % (testpath, msg)
                     rename(testpath + ".err", testpath)
                 else:
                     rename(testpath + ".err", testpath + ".out")
-                result('p', test)
+                success(test)
                 return
-        result('f', (test, msg))
+        results['f'].append((test, msg))
 
     def success():
-        result('p', test)
+        results['p'].append(test)
 
     def ignore(msg):
-        result('i', (test, msg))
+        results['i'].append((test, msg))
 
     if (os.path.basename(test).startswith("test-") and '~' not in test and
         ('.' not in test or test.endswith('.py') or
     sys.exit(failures != 0)
 
 results = dict(p=[], f=[], s=[], i=[])
-resultslock = threading.Lock()
 iolock = threading.Lock()
 
 def runqueue(options, tests, results):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.