changeset 985:31c75cfd7b06

runners: print more tailed lines when forked VM fails.
author shade
date Thu, 28 Aug 2014 17:42:31 +0400
parents c97ad3d4b507
children 7257b0afa007
files jmh-core/src/main/java/org/openjdk/jmh/runner/Runner.java
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/Runner.java	Thu Aug 28 16:50:03 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/Runner.java	Thu Aug 28 17:42:31 2014 +0400
@@ -77,6 +77,9 @@
  * static class in future releases.</p>
  */
 public class Runner extends BaseRunner {
+
+    private static final int TAIL_LINES_ON_ERROR = 20;
+
     private final BenchmarkList list;
     private int cpuCount;
 
@@ -656,13 +659,13 @@
 
             if (ecode != 0) {
                 out.println("<forked VM failed with exit code " + ecode + ">");
-                out.println("<stdout last='10 lines'>");
-                for (String l : FileUtils.tail(stdOut, 10)) {
+                out.println("<stdout last='" + TAIL_LINES_ON_ERROR + " lines'>");
+                for (String l : FileUtils.tail(stdOut, TAIL_LINES_ON_ERROR)) {
                     out.println(l);
                 }
                 out.println("</stdout>");
-                out.println("<stderr last='10 lines'>");
-                for (String l : FileUtils.tail(stdErr, 10)) {
+                out.println("<stderr last='" + TAIL_LINES_ON_ERROR + " lines'>");
+                for (String l : FileUtils.tail(stdErr, TAIL_LINES_ON_ERROR)) {
                     out.println(l);
                 }
                 out.println("</stderr>");