-
Notifications
You must be signed in to change notification settings - Fork 154
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
[infinitest-intellij] IntelliJ 'Make project automatically' and Infinitest test runs not synchronized? #178
Comments
I too have run into this problem on Eclipse Neon.2. The "race" conditions between infinitest and maven building causes the editor UI to hang for one to two seconds at a time. As a simple workaround, if I could have a toolbar button to disable infinitest right before I click on my Maven/"Run As" ... I would be happy. It is much to cumbersome to find the checkbox in the preferences options dialog for infinitest. If there was a way for Infinitest to have triggers to know that it needs to disable itself - that would be a stretch goal. |
To workaround this issue in IntelliJ, I have disabled "Build project automatically" and created an IntelliJ Macro that saves and builds the project, and assigned that to cmd+S instead. Seems to be working ok. |
Thanks for reporting the issue and a workaround @dylanwatsonsoftware |
I have not had a chance to look at the code but this is what I am seeing. When the file is saved, IntelliJ does compile the class but Infinitest does not pick it up. But when you do a ⌘-⇧-F9 then IntelliJ also saves and builds the file and Infinitest does pick up that change. I wonder if there is an event it is listening to and not after a file save only. |
The Infinitest plugin listens for build events here: https://github.com/infinitest/infinitest/blob/master/infinitest-intellij/src/main/java/org/infinitest/intellij/idea/IdeaCompilationListener.java The listener seems to be called from here: https://git.jetbrains.org/?p=idea/community.git;a=blob;f=platform/lang-impl/src/com/intellij/task/impl/ProjectTaskManagerImpl.java;h=2941b40f7faf9c272292bf24679fb4091092f586;hb=2593f961462b95e5921dff60e7509d3f244b8fff#l351 But when I tried debugging it, it looked to me like that listener is not called after an auto build. |
I'm not sure how to describe my problem other than to give anecdotal evidence and perhaps others can confirm or reject what I think I'm seeing here.
On IntelliJ 13.1.6, I'm running a fairly complex Integration test suite with lots of Spring DI going on with hibernate and helper modules. I will frequently see Infinitest running a test where the the spring dependency injector gets confused and it will throw lots of invalid context exceptions and dump huge numbers of failed tests onto the infinitest list that sometimes do not clear on their own. My integration tests run for 30 seconds or so, and so race conditions are pretty easy to come by.
My suspicion here is that Infinitest launches test runs at the same time that IntelliJ is writing out .class files due to the 'Make project automatically' setting being checked. Spring isn't used to having the rug pulled out from under it and is bombing at odd times during its long initialization.
If I am right about the lack of synchronization in the IntelliJ plugin, then I would like to request an enhancement for Infinitest that it synchronize with IntelliJ and block it from doing a make while the tests are running. And likewise, Infinitest should wait on starting a test run if it sees that IntelliJ is in the middle of doing a build.
I have no idea if such synchronization is possible given the IntelliJ API's, but I would like to put the enhancement request out there in case it is possible.
The text was updated successfully, but these errors were encountered: