[jira] [Comment Edited] (SUREFIRE-1222) ForkClient attempts to consume unrelated lines

2016-09-20 Thread Tibor Digana (JIRA)

[ 
https://issues.apache.org/jira/browse/SUREFIRE-1222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15507828#comment-15507828
 ] 

Tibor Digana edited comment on SUREFIRE-1222 at 9/20/16 9:24 PM:
-

[~mkouba]
It is not that fast and not without troubles to use other than std/out, e.g. 
file system right now.
It would be easier to use a magic number in the beginning of the stream, e.g. 
0x0F, 0xAC, 0x0B, 0xAD.
Surefire will process lines which start with magic number; otherwise it will be 
printed in console.
The problem should be fixed in Arquillian as well; otherwise the output will 
not be associated with current Thread of the test and would not appear in 
surefire-reports in particular Test-*.txt file report and not in the Maven Site 
test report.


was (Author: tibor17):
[~mkouba]
It is not that fast and not without troubles to use other that std/out, e.g. 
file system right now.
It would be easier to use a magic number in the beginning of the stream, e.g. 
0x0F, 0xAC, 0x0B, 0xAD.
Surefire will process lines which start with magic number; otherwise it will be 
printed in console.
The problem should be fixed in Arquillian as well; otherwise the output will 
not be associated current Thread of the test and would not appear in 
surefire-reports in particular Test-*.txt file report and not in the Maven Site 
test report.

> ForkClient attempts to consume unrelated lines
> --
>
> Key: SUREFIRE-1222
> URL: https://issues.apache.org/jira/browse/SUREFIRE-1222
> Project: Maven Surefire
>  Issue Type: Bug
>  Components: Maven Surefire Plugin, process forking
>Affects Versions: 2.17
> Environment: Oracle JDK7 (build 1.7.0_79-b15)
> Linux 3.13 x86_64 with default locale cs_CZ
>Reporter: Martin Kouba
>
> This month the [Weld 
> SE|https://github.com/weld/core/tree/2.3/environments/se/tests] test suite 
> suddenly started to fail on a Linux machine with Oracle JDK7 and the default 
> locale {{cs_CZ}}:
> {code}
> Caused by: java.lang.StringIndexOutOfBoundsException: String index out of 
> range: -1
>   at java.lang.String.substring(String.java:1911)
>   at 
> org.apache.maven.plugin.surefire.booterclient.output.ForkClient.consumeLine(ForkClient.java:128)
>   at 
> org.apache.maven.plugin.surefire.booterclient.output.ThreadedStreamConsumer$Pumper.run(ThreadedStreamConsumer.java:67)
>   at java.lang.Thread.run(Thread.java:745)
> {code}
> A {{java.util.logging.Logger}} is used in the forked process. The exception 
> occurs when the following log message is written to the standard output:
> {code}
> I 29, 2016 2:01:43 ODP. org.jboss.arquillian.container.se.server.Main main
> {code}
> We have found out that the timestamp *I 29, 2016 2:01:43* (i.e. 2016-01-29 
> 14:01:43) is incorrectly parsed as {{ForkingRunListener.BOOTERCODE_SYSPROPS}} 
> operation.
> I think the protocol should be robust enough to avoid similar collisions.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Comment Edited] (SUREFIRE-1222) ForkClient attempts to consume unrelated lines

2016-09-20 Thread Tibor Digana (JIRA)

[ 
https://issues.apache.org/jira/browse/SUREFIRE-1222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15507782#comment-15507782
 ] 

Tibor Digana edited comment on SUREFIRE-1222 at 9/20/16 9:05 PM:
-

[~mkouba]

This code should be okay 
https://github.com/wildfly/wildfly-arquillian/blob/master/container-managed/src/main/java/org/jboss/as/arquillian/container/managed/ManagedDeployableContainer.java#L349

Regarding the code you pointed out
{code}
new ProcessBuilder("echo", "I 29, 2016 2:01:43 
ODP.").redirectOutput(Redirect.INHERIT).start();
{code}
I found the problem. Try to find {{java.lang.ProcessImpl}} in JDK 8 latest 102 
and you will find method:
{code}
start(String cmdarray[],
 java.util.Map environment,
 String dir,
 ProcessBuilder.Redirect[] redirects,
 boolean redirectErrorStream)
{code}

which is called from {{ProcessBuilder.start()}} and you will find this code:
{code}
else if (redirects[1] == Redirect.INHERIT)
stdHandles[1] = fdAccess.getHandle(FileDescriptor.out);
{code}

which calls static context {{FileDescriptor.out}}

This means that the constant references the native {{PrintStream}} which was 
set prior to the stream we set in Surefire after ForkedBooter replaced the 
std/out stream by internal one.


was (Author: tibor17):
[~mkouba]

This code should be okay 
https://github.com/wildfly/wildfly-arquillian/blob/master/container-managed/src/main/java/org/jboss/as/arquillian/container/managed/ManagedDeployableContainer.java#L349

Regarding the code you pointed out
{code}
new ProcessBuilder("echo", "I 29, 2016 2:01:43 
ODP.").redirectOutput(Redirect.INHERIT).start();
{code}
I found the problem. Try to find {{java.lang.ProcessImpl}} in JDK 8 latest 102 
and you will find method:
{code}
start(String cmdarray[],
 java.util.Map environment,
 String dir,
 ProcessBuilder.Redirect[] redirects,
 boolean redirectErrorStream)
{code}

which is called from {{ProcessBuilder.start()}} and you will find this code:
{code}
else if (redirects[1] == Redirect.INHERIT)
stdHandles[1] = fdAccess.getHandle(FileDescriptor.out);
{code}

which calls static context {{FileDescriptor.out}}

This means that the constant references the native {{PrintStream}} which was 
prior to the stream we set in Surefire after ForkedBooter replaced the std/out 
stream by internal one.

> ForkClient attempts to consume unrelated lines
> --
>
> Key: SUREFIRE-1222
> URL: https://issues.apache.org/jira/browse/SUREFIRE-1222
> Project: Maven Surefire
>  Issue Type: Bug
>  Components: Maven Surefire Plugin, process forking
>Affects Versions: 2.17
> Environment: Oracle JDK7 (build 1.7.0_79-b15)
> Linux 3.13 x86_64 with default locale cs_CZ
>Reporter: Martin Kouba
>
> This month the [Weld 
> SE|https://github.com/weld/core/tree/2.3/environments/se/tests] test suite 
> suddenly started to fail on a Linux machine with Oracle JDK7 and the default 
> locale {{cs_CZ}}:
> {code}
> Caused by: java.lang.StringIndexOutOfBoundsException: String index out of 
> range: -1
>   at java.lang.String.substring(String.java:1911)
>   at 
> org.apache.maven.plugin.surefire.booterclient.output.ForkClient.consumeLine(ForkClient.java:128)
>   at 
> org.apache.maven.plugin.surefire.booterclient.output.ThreadedStreamConsumer$Pumper.run(ThreadedStreamConsumer.java:67)
>   at java.lang.Thread.run(Thread.java:745)
> {code}
> A {{java.util.logging.Logger}} is used in the forked process. The exception 
> occurs when the following log message is written to the standard output:
> {code}
> I 29, 2016 2:01:43 ODP. org.jboss.arquillian.container.se.server.Main main
> {code}
> We have found out that the timestamp *I 29, 2016 2:01:43* (i.e. 2016-01-29 
> 14:01:43) is incorrectly parsed as {{ForkingRunListener.BOOTERCODE_SYSPROPS}} 
> operation.
> I think the protocol should be robust enough to avoid similar collisions.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Comment Edited] (SUREFIRE-1222) ForkClient attempts to consume unrelated lines

2016-09-20 Thread Tibor Digana (JIRA)

[ 
https://issues.apache.org/jira/browse/SUREFIRE-1222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15507782#comment-15507782
 ] 

Tibor Digana edited comment on SUREFIRE-1222 at 9/20/16 9:01 PM:
-

[~mkouba]

This code should be okay 
https://github.com/wildfly/wildfly-arquillian/blob/master/container-managed/src/main/java/org/jboss/as/arquillian/container/managed/ManagedDeployableContainer.java#L349

Regarding the code you pointed out
{code}
new ProcessBuilder("echo", "I 29, 2016 2:01:43 
ODP.").redirectOutput(Redirect.INHERIT).start();
{code}
I found the problem. Try to find {{java.lang.ProcessImpl}} in JDK 8 latest 102 
and you will find method:
{code}
start(String cmdarray[],
 java.util.Map environment,
 String dir,
 ProcessBuilder.Redirect[] redirects,
 boolean redirectErrorStream)
{code}

which is called from {{ProcessBuilder.start()}} and you will find this code:
{code}
else if (redirects[1] == Redirect.INHERIT)
stdHandles[1] = fdAccess.getHandle(FileDescriptor.out);
{code}

which calls static context {{FileDescriptor.out}}

This means that the constant references the native {{PrintStream}} which was 
prior to the stream we set in Surefire after ForkedBooter replaced the std/out 
stream by internal one.


was (Author: tibor17):
[~mkouba]

This code should be okay 
https://github.com/wildfly/wildfly-arquillian/blob/master/container-managed/src/main/java/org/jboss/as/arquillian/container/managed/ManagedDeployableContainer.java#L349

Regarding {{new ProcessBuilder("echo", "I 29, 2016 2:01:43 
ODP.").redirectOutput(Redirect.INHERIT).start();}}
I found the problem. Try to find {{java.lang.ProcessImpl}} in JDK 8 latest 102 
and you will find method:
{{start(String cmdarray[],
 java.util.Map environment,
 String dir,
 ProcessBuilder.Redirect[] redirects,
 boolean redirectErrorStream)}}

which is called from {{ProcessBuilder.start()}} and you will find this code:
{{else if (redirects[1] == Redirect.INHERIT)
stdHandles[1] = fdAccess.getHandle(FileDescriptor.out);}}

which calls static context {{FileDescriptor.out}}

This means that the constant references the native {{PrintStream}} which was 
prior to the stream we set in Surefire after ForkedBooter replaced the std/out 
stream by internal one.

> ForkClient attempts to consume unrelated lines
> --
>
> Key: SUREFIRE-1222
> URL: https://issues.apache.org/jira/browse/SUREFIRE-1222
> Project: Maven Surefire
>  Issue Type: Bug
>  Components: Maven Surefire Plugin, process forking
>Affects Versions: 2.17
> Environment: Oracle JDK7 (build 1.7.0_79-b15)
> Linux 3.13 x86_64 with default locale cs_CZ
>Reporter: Martin Kouba
>
> This month the [Weld 
> SE|https://github.com/weld/core/tree/2.3/environments/se/tests] test suite 
> suddenly started to fail on a Linux machine with Oracle JDK7 and the default 
> locale {{cs_CZ}}:
> {code}
> Caused by: java.lang.StringIndexOutOfBoundsException: String index out of 
> range: -1
>   at java.lang.String.substring(String.java:1911)
>   at 
> org.apache.maven.plugin.surefire.booterclient.output.ForkClient.consumeLine(ForkClient.java:128)
>   at 
> org.apache.maven.plugin.surefire.booterclient.output.ThreadedStreamConsumer$Pumper.run(ThreadedStreamConsumer.java:67)
>   at java.lang.Thread.run(Thread.java:745)
> {code}
> A {{java.util.logging.Logger}} is used in the forked process. The exception 
> occurs when the following log message is written to the standard output:
> {code}
> I 29, 2016 2:01:43 ODP. org.jboss.arquillian.container.se.server.Main main
> {code}
> We have found out that the timestamp *I 29, 2016 2:01:43* (i.e. 2016-01-29 
> 14:01:43) is incorrectly parsed as {{ForkingRunListener.BOOTERCODE_SYSPROPS}} 
> operation.
> I think the protocol should be robust enough to avoid similar collisions.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)