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

Java agent printing to native console makes build block when using SurefireForkNodeFactory




      This is a follow-up to SUREFIRE-1788 which was closed prematurely even though there still were open issues which were discussed there initially. Basically the situation is as follows:

      • I use Java agents writing to stdOut and stdErr in my tests.
      • I was annoyed that Surefire/Failsafe were writing lots of [WARNING] Corrupted STDOUT by directly writing to native stream in forked JVM lines into *-jvmRun1.dumpstream files. tibordigana then told me to use <forkNode implementation="org.apache.maven.plugin.surefire.extensions.SurefireForkNodeFactory"/> in my POM in order to fix the issue.
      • I tried this in version 3.0.0-M5, but unfortunately, it makes Surefire/Failsafe freeze if a Java agent prints something to stdOut or stdErr. This happens both in M5 and in M6-SNAPSHOT after both SUREFIRE-1788 and SUREFIRE-1809 have been merged in already.
      • My sample project reproduces the issue as soon as you uncomment the option in the POM and run mvn clean verify.
      • The second issue is: Not using this option leads to garbled log output when a Java agent writes to both stdOut and stdErr before/during tests. See comments in class Agent.DummyTransformer for examples for garbled log lines and also comments in pom.xml for further information.
      • If the garbled output would also appear with this option activated, cannot be tested at present due to the Surefire/Failsafe freeze. I will re-test that after the freeze has been fixed and before this issue can be closed.


        1. maven-failsafe-debug-log.txt
          18 kB
          Alexander Kriegisch
        2. image-2021-02-08-12-07-34-183.png
          57 kB
          Alexander Kriegisch
        3. screenshot-1.png
          136 kB
          Alexander Kriegisch
        4. image-2021-03-26-09-48-11-398.png
          55 kB
          Alexander Kriegisch
        5. image-2021-03-26-09-52-36-881.png
          55 kB
          Alexander Kriegisch
        6. image-2021-03-26-18-00-37-889.png
          72 kB
          Alexander Kriegisch
        7. Bildschirmfoto von 2021-03-29 21-50-25.png
          138 kB
          Patrick Reinhart
        8. screenshot-2.png
          27 kB
          Alexander Kriegisch
        9. image-2021-03-31-11-22-50-682.png
          6 kB
          Alexander Kriegisch
        10. image-2021-03-31-11-38-11-119.png
          171 kB
          Alexander Kriegisch
        11. image-2021-03-31-12-31-55-818.png
          42 kB
          Alexander Kriegisch
        12. image-2021-03-31-12-32-41-589.png
          42 kB
          Alexander Kriegisch

        Issue Links



              tibordigana Tibor Digana
              kriegaex Alexander Kriegisch
              0 Vote for this issue
              4 Start watching this issue