Uploaded image for project: 'Maven Surefire'
  1. Maven Surefire
  2. SUREFIRE-775

ForkingRunListener throws ArrayIndexOutOfBoundsException

    XMLWordPrintableJSON

Details

    Description

      We came across this in wicketstuff project in a scala using module on jenkins CI when we tried to enable parallel test runs.
      Maybe the problem is that in ForkingRunListener#info(String) if you pass a message with 1 byte length the allocated ByteBuffer will be too small: 6 byte in length.

      Relevant stacktrace part from jenkins:

      Caused by: java.lang.ArrayIndexOutOfBoundsException: 6
      	at org.apache.maven.surefire.util.internal.ByteBuffer.append(ByteBuffer.java:45)
      	at org.apache.maven.surefire.booter.ForkingRunListener.info(ForkingRunListener.java:223)
      	at org.apache.maven.surefire.junitcore.ConcurrentReporterManager.writeTestOutput(ConcurrentReporterManager.java:175)
      	at org.apache.maven.surefire.report.ConsoleOutputCapture$ForwardingPrintStream.write(ConsoleOutputCapture.java:56)
      	at sun.nio.cs.StreamEncoder$CharsetSE.writeBytes(StreamEncoder.java:336)
      	at sun.nio.cs.StreamEncoder$CharsetSE.implFlushBuffer(StreamEncoder.java:404)
      	at sun.nio.cs.StreamEncoder.flushBuffer(StreamEncoder.java:115)
      	at java.io.OutputStreamWriter.flushBuffer(OutputStreamWriter.java:169)
      	at java.io.PrintStream.newLine(PrintStream.java:478)
      	at java.io.PrintStream.println(PrintStream.java:754)
      	at scala.Console$.println(Console.scala:244)
      	at scala.Predef$.println(Predef.scala:192)
      	at org.wicketstuff.scala.sample.HomePage.<init>(HelloWicketWorld.scala:35)
      	... 113 more
      

      Attachments

        Activity

          People

            krosenvold Kristian Rosenvold
            akiraly Attila Király
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: