changeset 254:f1bedd45376f

Runners: generate report in parallel.
author shade
date Fri, 13 May 2016 20:53:28 +0300
parents 8ad4e15435b4
children 99385f86b4f6
files jcstress-core/src/main/java/org/openjdk/jcstress/infra/grading/HTMLReportPrinter.java
diffstat 1 files changed, 12 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/grading/HTMLReportPrinter.java	Fri May 13 20:33:50 2016 +0300
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/grading/HTMLReportPrinter.java	Fri May 13 20:53:28 2016 +0300
@@ -252,8 +252,7 @@
                              String header,
                              String subheader,
                              Predicate<Status> filterStatus,
-                             Predicate<TestGrading> filterGrading
-                             ) throws FileNotFoundException {
+                             Predicate<TestGrading> filterGrading) {
         output.println("<hr>");
         output.println("<h3>" + header + "</h3>");
         output.println("<p>" + subheader + "</p>");
@@ -367,13 +366,17 @@
         }
     }
 
-    private void emitTestReports(Multimap<String, TestResult> multiByName) throws FileNotFoundException {
-        for (String name : multiByName.keys()) {
-            TestInfo test = TestList.getInfo(name);
-            PrintWriter local = new PrintWriter(resultDir + "/" + name + ".html");
-            emitTestReport(local, multiByName.get(name), test);
-            local.close();
-        }
+    private void emitTestReports(Multimap<String, TestResult> multiByName) {
+        multiByName.keys().parallelStream().forEach(name -> {
+            try {
+                TestInfo test = TestList.getInfo(name);
+                PrintWriter local = new PrintWriter(resultDir + "/" + name + ".html");
+                emitTestReport(local, multiByName.get(name), test);
+                local.close();
+            } catch (FileNotFoundException e) {
+                // do nothing
+            }
+        });
     }
 
     public void emitTestReport(PrintWriter output, Collection<TestResult> results, TestInfo test) {