[
https://issues.apache.org/jira/browse/SUREFIRE-1881?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17280470#comment-17280470
]
Tibor Digana commented on SUREFIRE-1881:
----------------------------------------
It was observed from Windows 10.
I am using this line {{<forkNode
implementation="org.apache.maven.plugin.surefire.extensions.SurefireForkNodeFactory"/>}}
and I have observed exactly the same screen as you had (printed *T E S T S*
and then nothing). The dump file exists with the exception in it.
After the {{forkNode}} is deleted the test runs but strange and broken test
summary is printed which cannot be normally read. How this can be explained?
{noformat}
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.378 s
- in de.scrum_master.dummy.AgentIT
[Transformer OUT] className = org/junit/runner/notification/RunNotifier$2,
loader = jdk.internal.loader.ClassLoaders$AppClassLoader@6ff3c5b5
[Transformer ERR] className = org/junit/runner/notification/RunNotifier$2,
class file size = 1131
[Transformer OUT] className = org/apache/maven/surefire/api/suite/RunResult,
loader = jdk.internal.loader.ClassLoaders$AppClassLoader@6ff3c5b5
[Transformer ERR] className = org/apache/maven/surefire/api/suite/RunResult,
class file size = 5263
[Transformer OUT] className = org/apache/maven/surefire/booter/ForkedBooter$6,
loader = jdk.internal.loader.ClassLoaders$AppClassLoader@6ff3c5b5
[Transformer ERR] className = org/apache/maven/surefire/booter/ForkedBooter$6,
class file size = 1036
[Transformer OUT] className = org/apache/maven/surefire/booter/ForkedBooter$7,
loader = jdk.internal.loader.ClassLoaders$AppClassLoader@6ff3c5b5
[Transformer ERR] className = org/apache/maven/surefire/booter/ForkedBooter$7,
class file size = 1564
[Transformer OUT] className =
java/util/concurrent/ScheduledThreadPoolExecutor$ScheduledFutureTask, loader =
null
Transformer ERR] className =
java/util/concurrent/ScheduledThreadPoolExecutor$ScheduledFutureTask, class
file size =[ 4I3NF3O8]
[INFO] Results:
[Transformer OUT] className = java/util/concurrent/FutureTask, loader = null
m[TrINaFnOsf]o r
ir[ ERIRN]F Ocl]a ssNTaemset s= rjuanv:a /1u,t iFla/iclounrceusr:r e0n,t
/EFrurtourrse:T a0s,k ,S kcilpapseds: 0 f
[eI NsFiOze] =
9022
[WARNING] Corrupted STDOUT by directly writing to native stream in forked JVM
1. See FAQ web page and the dump file
c:\vcs\github\Maven_Surefire_PrintToConsoleProblems\target\failsafe-reports\2021-02-06T20-17-54_730-jvmRun1.dumpstream
[Transformer OUT] className = java/util/concurrent/FutureTask$WaitNode, loader
= null
-Transformer ERR] className = java/util/concurrent/FutureTask$WaitNo[de,I
NcFlOas]s f-i-l-e- -s-i-z-e- -=- -5-5-4-
--------------------------------------------------------
[Transformer OUT] className = java/util/concurrent/Executors$RunnableAdapter,
loader = null
[TraInNsFfOor]m er BEURIRL]D cSlUaCsCsENSaSme
- [jIaNvFaO/u]t
il-/-c-o-n-c-u-r-r-e-n-t-/-E-x-e-c-u-t-o-r-s-$-R-u-n-n-a-b-l-e-A-d-a-p-t-e-r-,-
-c-l-a-s-s- -f-i-l-e- -s-i-z-e- -=- -1-4-3-2-
---------
[Transformer OUT] className = java/util/concurrent/ThreadPoolExecutor$Worker,
loader = null
v[TranIsNfFoOrm] Terot ERaRl] t icmlea:s s N1a1m.e2 0=1 jsa
s/u[tiIlN/FcOon]c uFrirneinsth/eTdh raeta:d
P2o0o2l1E-x0e2c-u0t6orT20$:W1o8r:k0e0r+,0 1c:l0a0s
-[filIeN FsOiz]e =- -2-3-9-7-
-----------------------------------------------------------------
[Transformer OUT] className =
java/util/concurrent/locks/AbstractQueuedSynchronizer$SharedNode, load
{noformat}
> Java agent printing to native console makes build block when using
> SurefireForkNodeFactory
> ------------------------------------------------------------------------------------------
>
> Key: SUREFIRE-1881
> URL: https://issues.apache.org/jira/browse/SUREFIRE-1881
> Project: Maven Surefire
> Issue Type: Bug
> Components: Maven Failsafe Plugin, Maven Surefire Plugin
> Affects Versions: 3.0.0-M5
> Reporter: Alexander Kriegisch
> Priority: Major
>
> 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|https://github.com/kriegaex/Maven_Surefire_PrintToConsoleProblems]
> 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}}|https://github.com/kriegaex/Maven_Surefire_PrintToConsoleProblems/blob/master/src/main/java/de/scrum_master/dummy/Agent.java]
> for examples for garbled log lines and also comments in
> [pom.xml|https://github.com/kriegaex/Maven_Surefire_PrintToConsoleProblems/blob/master/pom.xml#L36]
> 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.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)