yegor256 / qulice

Quality Police for Java projects: aggregator of Checkstyle and PMD
https://www.qulice.com
Other
299 stars 110 forks source link

CheckstyleValidatorTest fails intermittently #691

Open simonjenga opened 8 years ago

simonjenga commented 8 years ago

While trying to create a JAR for this project using the command: ./qulice>mvn clean package the BUILD sometimes fails or succeeds. This happens intermittently.

[INFO ] com.qulice.checkstyle.CheckstyleValidator: No Checkstyle violations found in 2 files
Tests run: 23, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 16.551 sec <<< FAILURE! - in com.qulice.checkstyle.CheckstyleValidatorTest
distinguishesValidCatchParameterNames(com.qulice.checkstyle.CheckstyleValidatorTest)  Time elapsed: 0.015 sec  <<< ERROR!
java.lang.IllegalStateException: mkdir failed
        at com.qulice.spi.Environment$Mock.<init>(Environment.java:165)
        at com.qulice.checkstyle.CheckstyleValidatorTest.runValidation(CheckstyleValidatorTest.java:547)
        at com.qulice.checkstyle.CheckstyleValidatorTest.distinguishesValidCatchParameterNames(CheckstyleValidatorTest.java:442)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at org.junit.rules.RunRules.evaluate(RunRules.java:20)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
        at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:387)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)

Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8

Results :

Tests in error:
  CheckstyleValidatorTest.distinguishesValidCatchParameterNames:442->runValidation:547 -+ IllegalState

Tests run: 53, Failures: 0, Errors: 1, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] qulice ............................................ SUCCESS [1.030s]
[INFO] qulice-spi ........................................ SUCCESS [3.182s]
[INFO] qulice-checkstyle ................................. FAILURE [19.174s]
[INFO] qulice-pmd ........................................ SKIPPED
[INFO] qulice-codenarc ................................... SKIPPED
[INFO] qulice-findbugs ................................... SKIPPED
[INFO] qulice-xml ........................................ SKIPPED
[INFO] qulice-ant ........................................ SKIPPED
[INFO] qulice-maven-plugin ............................... SKIPPED
[INFO] qulice-gradle-plugin .............................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
krzyk commented 8 years ago

@simonjenga strange, do you have space in java.io.tmp directory? Could you show what you have in System.getProperty("java.io.tmpdir")? Also please give us details about maven/os (mvn --version)

simonjenga commented 8 years ago

@krzyk There are intermittent results (FAILURE/SUCCESS) within Unit tests that have something to do with creating files in the temp Dir in my computer.

System.out.println(System.getProperty("java.io.tmpdir"));
C:\Users\fatcat\AppData\Local\Temp\

Try to reproduce this issue in the following environment:

Java version: 1.7.0_80, vendor: Oracle Corporation
Java home: C:\Program Files (x86)\Java\jdk1.7.0_80\jre
Apache Maven >= 3.1.1
Default locale: en_GB, platform encoding: UTF-8
OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"

The same error messages may appear on: Apache Maven 3.2.1, Apache Maven 3.2.5 and Apache Maven 3.3.3

I also experience a similar problem at: https://github.com/yegor256/takes/issues/506

krzyk commented 8 years ago

@simonjenga please update the issue description with your OS/Maven data, and it is enough to have only one log entry.

simonjenga commented 8 years ago

@krzyk I have already provided you with that information.

krzyk commented 8 years ago

@simonjenga Yes, but in the comments, issue description is not very readable right now. Please leave there only the stack trace, os/maven version, tmp directly name, maven command. The rest move to an attachment.

simonjenga commented 8 years ago

@krzyk https://gist.github.com/simonjenga/3a3b7e51c4e5e53c74ae

krzyk commented 8 years ago

@simonjenga nice, but I want the description of the issue to be clear, right now it contains only some logs. Description, not comments below.

simonjenga commented 8 years ago

@krzyk See updated comment.

The reason this FAILURE happens is because this project generates and fills my temp Dir with a lot of folders >500 and it does not delete them. I have to manually delete them to make the Build to pass.

qulicetempfolders

krzyk commented 8 years ago

@davvd valid bug

davvd commented 8 years ago

@davvd valid bug

@krzyk I tagged this as "bug"

krzyk commented 8 years ago

@davvd this is postponed

davvd commented 8 years ago

@davvd this is postponed

@krzyk sure, thanks, I added "postponed" label to it

davvd commented 8 years ago

@davvd this is postponed

@krzyk got it, someone else will be assigned soon

davvd commented 8 years ago

@simonjenga thank you for reporting this, I added 15 mins to your acc, transaction 78702197

simonjenga commented 8 years ago

@davvd OK, thanks!

davvd commented 8 years ago

@davvd OK, thanks!

@simonjenga np :)