Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
3.0.0-M6
-
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: [...]
Java version: 17.0.3, vendor: BellSoft, runtime: C:\Users\[...]\.sdkman\candidates\java\17.0.3-librca
Default locale: de_DE, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f) Maven home: [...] Java version: 17.0.3, vendor: BellSoft, runtime: C:\Users\[...]\.sdkman\candidates\java\17.0.3-librca Default locale: de_DE, platform encoding: Cp1252 OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
Description
surefire 3.0.0-M6 excludes a test from the test result, if an exception with a long message (~1000) is thrown from an inner class.
$ mvn test [...] [INFO] Running org.example.ThrowExceptionWithLongMessageTest [INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.044 s - in org.example.ThrowExceptionWithLongMessageTest [INFO] [INFO] Results: [INFO] [INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0 [INFO] [WARNING] Corrupted channel by directly writing to native stream in forked JVM 1. See FAQ web page and the dump file [INFO] [...] [...] [INFO] BUILD SUCCESS
with
test class
package org.example; import org.junit.jupiter.api.Test; class ThrowExceptionWithLongMessageTest { @Test public void example() { Inner.throwException(1000); } public static class Inner { public static void throwException(final int messageLen) { final var sb = new StringBuilder(); for (int i = 0; i < messageLen; i++) { sb.append("A"); } throw new IllegalStateException(sb.toString()); } } }
Demonstrator: see links
surefire 3.0.0-M5 fails the test like expected:
[INFO] Running org.example.ThrowExceptionWithLongMessageTest [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.036 s <<< FAILURE! - in org.example.ThrowExceptionWithLongMessageTest
Attachments
Attachments
Issue Links
- is related to
-
SUREFIRE-2058 Corrupted STDOUT by directly writing to native stream in forked JVM 1 with UTF-8 console logging
- Closed
- links to