updated tests are not compiling unless whole project is rebuilt

Answered

I have been facing some weird problem in my intellij setup - I have been using Intellij for many years but never faced this.

Project build tool - Gradle and auto-import is enabled.

I have also enabled Make project automatically.

 

Still not sure what is causing the issue - when I update the tests and rerun it, its not taking latest updates and takes older compiled tests. And I have to Rebuild entire project to compile the updates - which is quite annoying.

And this happens only on couple of projects. Please suggest what settings I need to change.

Version being used.

Thanks,

Kunal

9 comments
Comment actions Permalink

Do you have Build step enabled in the test run/debug configuration before launch steps?

0
Comment actions Permalink

Yes, Before launch I have enabled Make. But behavior is no different.


0
Comment actions Permalink

You may want to enable debug logging for build.log and check the log to see if the file you change inside IDE is updated on Build: https://intellij-support.jetbrains.com/hc/articles/207241085.

Does the .class file for this test change the timestamp after you modify the source and Build the project?

1
Comment actions Permalink

I have changed log level to debug and its I see lot of logs being dumped in build.log but not able to understand that.

However I see that timestamp of .class file is not getting changed as soon as change the test method. But when I compile the class explicitly from Build > Compile ***.java - timestamp is getting updated and updated test also works. How do I get rid of this problem ?

0
Comment actions Permalink

To understand the problem we'll need a reproducible test case.

0
Comment actions Permalink

Just noticed that your IDE version is too old, it could be some issue that was fixed long time ago. Did you try with the latest version from http://www.jetbrains.com/idea/download/index.html? Does it have the same problem?

0
Comment actions Permalink

Somehow I tried creating sampleproject to reproduce the issue but there it was reproduced on the same intellij version :(

Any module specific configuration/settings which I missed ?

0
Comment actions Permalink

There is no setting that would affect it, it looks like a bug.

0

Please sign in to leave a comment.