New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Affected strategy analyze .class files when target dir not ignored #165

Closed
lordofthejars opened this Issue Sep 19, 2017 · 4 comments

Comments

Projects
None yet
3 participants
@lordofthejars
Member

lordofthejars commented Sep 19, 2017

Issue Overview

Affected strategy analyze .class files when target dir not ignored from git (.gitignore) and this causes an exception:

[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
[ERROR] Unable to analyze source file /Users/alex/git/stdemo/target/classes/org/superbiz/A.class
[ERROR] 	at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:665)
Expected Behaviour

.class files should be ignored.

Current Behaviour

Exception is thrown.

Steps To Reproduce
  1. Clone https://github.com/lordofthejars/stdemo
  2. Edit .gitignore and comment target/ line using #
  3. Run mvn clean test -Dsmart.testing="affected"
@MatousJobanek

This comment has been minimized.

Show comment
Hide comment
@MatousJobanek

MatousJobanek Sep 22, 2017

Contributor

I tried the reproduce the issue and it passed. There was a warning, but different one. I got this:

[WARNING] Corrupted stdin stream in forked JVM 1. See the dump file /home/mjobanek/tmp/stdemo/target/surefire-reports/2017-09-22T12-47-00_256-jvmRun1.dumpstream

and the content of the file:

# Created on 2017-09-22T12:47:01.799
Corrupted stdin stream in forked JVM 1. Stream '[INFO] [Smart Testing Extension] Applied strategies: [affected]'.
java.lang.IllegalArgumentException: Stream stdin corrupted. Expected comma after third character in command '[INFO] [Smart Testing Extension] Applied strategies: [affected]'.
        at org.apache.maven.plugin.surefire.booterclient.output.ForkClient$OperationalData.<init>(ForkClient.java:469)
        at org.apache.maven.plugin.surefire.booterclient.output.ForkClient.processLine(ForkClient.java:191)
        at org.apache.maven.plugin.surefire.booterclient.output.ForkClient.consumeLine(ForkClient.java:158)
        at org.apache.maven.plugin.surefire.booterclient.output.ThreadedStreamConsumer$Pumper.run(ThreadedStreamConsumer.java:87)
        at java.lang.Thread.run(Thread.java:745)


# Created on 2017-09-22T12:47:01.801
Corrupted stdin stream in forked JVM 1. Stream '[INFO] [Smart Testing Extension] Applied usage: [selecting]'.
java.lang.IllegalArgumentException: Stream stdin corrupted. Expected comma after third character in command '[INFO] [Smart Testing Extension] Applied usage: [selecting]'.
        at org.apache.maven.plugin.surefire.booterclient.output.ForkClient$OperationalData.<init>(ForkClient.java:469)
        at org.apache.maven.plugin.surefire.booterclient.output.ForkClient.processLine(ForkClient.java:191)
        at org.apache.maven.plugin.surefire.booterclient.output.ForkClient.consumeLine(ForkClient.java:158)
        at org.apache.maven.plugin.surefire.booterclient.output.ThreadedStreamConsumer$Pumper.run(ThreadedStreamConsumer.java:87)
        at java.lang.Thread.run(Thread.java:745)
Contributor

MatousJobanek commented Sep 22, 2017

I tried the reproduce the issue and it passed. There was a warning, but different one. I got this:

[WARNING] Corrupted stdin stream in forked JVM 1. See the dump file /home/mjobanek/tmp/stdemo/target/surefire-reports/2017-09-22T12-47-00_256-jvmRun1.dumpstream

and the content of the file:

# Created on 2017-09-22T12:47:01.799
Corrupted stdin stream in forked JVM 1. Stream '[INFO] [Smart Testing Extension] Applied strategies: [affected]'.
java.lang.IllegalArgumentException: Stream stdin corrupted. Expected comma after third character in command '[INFO] [Smart Testing Extension] Applied strategies: [affected]'.
        at org.apache.maven.plugin.surefire.booterclient.output.ForkClient$OperationalData.<init>(ForkClient.java:469)
        at org.apache.maven.plugin.surefire.booterclient.output.ForkClient.processLine(ForkClient.java:191)
        at org.apache.maven.plugin.surefire.booterclient.output.ForkClient.consumeLine(ForkClient.java:158)
        at org.apache.maven.plugin.surefire.booterclient.output.ThreadedStreamConsumer$Pumper.run(ThreadedStreamConsumer.java:87)
        at java.lang.Thread.run(Thread.java:745)


# Created on 2017-09-22T12:47:01.801
Corrupted stdin stream in forked JVM 1. Stream '[INFO] [Smart Testing Extension] Applied usage: [selecting]'.
java.lang.IllegalArgumentException: Stream stdin corrupted. Expected comma after third character in command '[INFO] [Smart Testing Extension] Applied usage: [selecting]'.
        at org.apache.maven.plugin.surefire.booterclient.output.ForkClient$OperationalData.<init>(ForkClient.java:469)
        at org.apache.maven.plugin.surefire.booterclient.output.ForkClient.processLine(ForkClient.java:191)
        at org.apache.maven.plugin.surefire.booterclient.output.ForkClient.consumeLine(ForkClient.java:158)
        at org.apache.maven.plugin.surefire.booterclient.output.ThreadedStreamConsumer$Pumper.run(ThreadedStreamConsumer.java:87)
        at java.lang.Thread.run(Thread.java:745)
@bartoszmajsak

This comment has been minimized.

Show comment
Hide comment
@bartoszmajsak

bartoszmajsak Sep 22, 2017

Member

That's exactly why I brought https://issues.apache.org/jira/browse/SUREFIRE-1359 to the table a while back :)

Member

bartoszmajsak commented Sep 22, 2017

That's exactly why I brought https://issues.apache.org/jira/browse/SUREFIRE-1359 to the table a while back :)

@MatousJobanek

This comment has been minimized.

Show comment
Hide comment
@MatousJobanek

MatousJobanek Sep 22, 2017

Contributor

Ok, I just reproduced it - sorry :-)
I didn't notice that I had target/ entry also in the global .gitignore file

Contributor

MatousJobanek commented Sep 22, 2017

Ok, I just reproduced it - sorry :-)
I didn't notice that I had target/ entry also in the global .gitignore file

@bartoszmajsak

This comment has been minimized.

Show comment
Hide comment
@bartoszmajsak

bartoszmajsak Sep 22, 2017

Member

I think it's because the build is executing in the forked surefire process and we share I/O with the surefire - and surefire uses to communicate between booter and fork runner.

Member

bartoszmajsak commented Sep 22, 2017

I think it's because the build is executing in the forked surefire process and we share I/O with the surefire - and surefire uses to communicate between booter and fork runner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment