Skip to content
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

Open
dwoldrich opened this issue Jul 20, 2015 · 5 comments
Labels
comp:infinitest-intellij Issues related to Infintest for IntelliJ (and other Jetbrains IDEs) type: feature

Comments

@dwoldrich
Copy link

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.

@sarod sarod added type: feature comp:infinitest-intellij Issues related to Infintest for IntelliJ (and other Jetbrains IDEs) labels Jun 10, 2016
@Clasmir
Copy link

Clasmir commented Feb 9, 2017

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.

@sarod sarod changed the title IntelliJ 'Make project automatically' and Infinitest test runs not synchronized? [infinitest-intellij] IntelliJ 'Make project automatically' and Infinitest test runs not synchronized? May 15, 2018
@dylanwatsonsoftware
Copy link

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.

@gtoison
Copy link
Contributor

gtoison commented Apr 4, 2023

Thanks for reporting the issue and a workaround @dylanwatsonsoftware
I'm trying to resolve the backlog of old issues but I've not been able to reproduce that one, actually I was not even able to get the "Build project automatically" feature to trigger tests with Infinitest.
It would be great if you could share some details on how to reproduce the problem (IntelliJ & Infinitest versions, project structure, maven/gradle etc.) or better yet a sample project I can use to reproduce. Please bear with me as I'm not an IntelliJ user!

@cpesarchick-home
Copy link

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.

@gtoison
Copy link
Contributor

gtoison commented May 25, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:infinitest-intellij Issues related to Infintest for IntelliJ (and other Jetbrains IDEs) type: feature
Projects
None yet
Development

No branches or pull requests

6 participants