Idea unable to debug unit tests

Answered

I upgraded Idea last week to the latest version, IntelliJ IDEA 2019.3.2 (Ultimate Edition)
Build #IU-193.6015.39, built on January 20, 2020.

I have a Spring Boot Gradle project and when I try to run the unit tests via debug either via the Menu or ^D nothing happens. The Debug tool window does not come up, I see no errors, just nothing. Using the Run via the Menu or ^R works fine, it's just Debug that does not work. Debugging did work fine until I upgraded IDEA last week.

The behavior is the same whether I try to run them as Gradle tests or Unit tests.

 

Any ideas what may have changed?

1
18 comments

Does the workaround from https://youtrack.jetbrains.com/issue/IDEA-228180 help?

Are there any errors in the logs: https://intellij-support.jetbrains.com/hc/articles/207241085 ?

I'd report a bug at https://youtrack.jetbrains.com/newIssue?project=IDEA with the logs attached (Help | Compress Logs and Show in ...).

0

The workaround did not help because my CONFIG/disabled_plugins.txt file is empty so there was nothing to delete from it.

I do get a stack trace in the logs whenever I press the Debug button. It looks like this:

2020-02-03 13:02:22,504 [ 260380]  ERROR - ution.ui.RunContentManagerImpl - Runner Debug is not registered 
java.lang.Throwable: Runner Debug is not registered
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:145)
at com.intellij.execution.ui.RunContentManagerImpl.getContentManagerForRunner(RunContentManagerImpl.java:472)
at com.intellij.execution.ui.RunContentManagerImpl.getReuseContent(RunContentManagerImpl.java:363)
at com.intellij.execution.impl.ExecutionManagerKtImpl.startRunProfile(ExecutionManagerKtImpl.kt:36)
at com.intellij.execution.runners.GenericProgramRunnerKt.startRunProfile(GenericProgramRunner.kt:50)
at com.intellij.execution.runners.GenericProgramRunner.execute(GenericProgramRunner.kt:17)
at com.intellij.execution.runners.BaseProgramRunner.execute(BaseProgramRunner.java:46)
at com.intellij.execution.runners.BaseProgramRunner.execute(BaseProgramRunner.java:35)
at com.intellij.execution.ProgramRunnerUtil.executeConfigurationAsync(ProgramRunnerUtil.java:103)
at com.intellij.execution.ProgramRunnerUtil.executeConfiguration(ProgramRunnerUtil.java:40)
at com.intellij.execution.impl.ExecutionManagerImpl.restart(ExecutionManagerImpl.java:95)
at com.intellij.execution.impl.ExecutionManagerImpl.access$300(ExecutionManagerImpl.java:46)
at com.intellij.execution.impl.ExecutionManagerImpl$3.run(ExecutionManagerImpl.java:471)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:231)
at com.intellij.util.Alarm$Request.runSafely(Alarm.java:371)
at com.intellij.util.Alarm$Request.run(Alarm.java:358)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at com.intellij.util.concurrency.SchedulingWrapper$MyScheduledFutureTask.run(SchedulingWrapper.java:217)
at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:309)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.doRun(LaterInvocator.java:441)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:424)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:407)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:908)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:781)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:424)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:698)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:423)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
2020-02-03 13:02:22,505 [ 260381]  ERROR - ution.ui.RunContentManagerImpl - IntelliJ IDEA 2019.3.2  Build #IU-193.6015.39
2020-02-03 13:02:22,505 [ 260381]  ERROR - ution.ui.RunContentManagerImpl - JDK: 11.0.5; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o
2020-02-03 13:02:22,505 [ 260381]  ERROR - ution.ui.RunContentManagerImpl - OS: Mac OS X
2020-02-03 13:02:22,505 [ 260381]  ERROR - ution.ui.RunContentManagerImpl - Last Action: Debug
2020-02-03 13:02:22,505 [ 260381]  ERROR - til.concurrency.QueueProcessor - @NotNull method com/intellij/execution/ui/RunContentManagerImpl.getContentManagerForRunner must not return null
java.lang.IllegalStateException: @NotNull method com/intellij/execution/ui/RunContentManagerImpl.getContentManagerForRunner must not return null
at com.intellij.execution.ui.RunContentManagerImpl.$$$reportNull$$$0(RunContentManagerImpl.java)
at com.intellij.execution.ui.RunContentManagerImpl.getContentManagerForRunner(RunContentManagerImpl.java:475)
at com.intellij.execution.ui.RunContentManagerImpl.getReuseContent(RunContentManagerImpl.java:363)
at com.intellij.execution.impl.ExecutionManagerKtImpl.startRunProfile(ExecutionManagerKtImpl.kt:36)
at com.intellij.execution.runners.GenericProgramRunnerKt.startRunProfile(GenericProgramRunner.kt:50)
at com.intellij.execution.runners.GenericProgramRunner.execute(GenericProgramRunner.kt:17)
at com.intellij.execution.runners.BaseProgramRunner.execute(BaseProgramRunner.java:46)
at com.intellij.execution.runners.BaseProgramRunner.execute(BaseProgramRunner.java:35)
at com.intellij.execution.ProgramRunnerUtil.executeConfigurationAsync(ProgramRunnerUtil.java:103)
at com.intellij.execution.ProgramRunnerUtil.executeConfiguration(ProgramRunnerUtil.java:40)
at com.intellij.execution.impl.ExecutionManagerImpl.restart(ExecutionManagerImpl.java:95)
at com.intellij.execution.impl.ExecutionManagerImpl.access$300(ExecutionManagerImpl.java:46)
at com.intellij.execution.impl.ExecutionManagerImpl$3.run(ExecutionManagerImpl.java:471)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:231)
at com.intellij.util.Alarm$Request.runSafely(Alarm.java:371)
at com.intellij.util.Alarm$Request.run(Alarm.java:358)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at com.intellij.util.concurrency.SchedulingWrapper$MyScheduledFutureTask.run(SchedulingWrapper.java:217)
at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:309)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.doRun(LaterInvocator.java:441)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:424)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:407)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:908)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:781)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:424)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:698)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:423)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
2020-02-03 13:02:22,506 [ 260382]  ERROR - til.concurrency.QueueProcessor - IntelliJ IDEA 2019.3.2  Build #IU-193.6015.39
2020-02-03 13:02:22,506 [ 260382]  ERROR - til.concurrency.QueueProcessor - JDK: 11.0.5; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o
2020-02-03 13:02:22,506 [ 260382]  ERROR - til.concurrency.QueueProcessor - OS: Mac OS X
2020-02-03 13:02:22,506 [ 260382]  ERROR - til.concurrency.QueueProcessor - Last Action: Debug

 

0

Yes that workaround seems to work, I checked the "Show F1, F2, etc keys on the the TouchBar" box and restarted IDEA, and now I can debug the tests again. Thanks.

0

I have the same issue with unit tests in gradle project. Maven works fine.

Nothing is written to the logs if I try to start debugging by clicking on the bug (context menu in the left margin, or in Gradle tool window or in the header area).

Tried with "Run tests using" Gradle and also IntelliJ IDEA. After a whole day of restarting, invalidating cache, .... nothing changed. No logs, no hint, nothing. 

Any help appriciated! (Went already through the links above, stackoverflow, ....)

idea information:

IntelliJ IDEA 2021.2.4 (Ultimate Edition)
Build #IU-212.5712.43, built on December 21, 2021
Runtime version: 11.0.13+8-b1504.49 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 5.4.0-96-generic
GC: ParNew, ConcurrentMarkSweep
Memory: 4029M
Cores: 8
Registry: debugger.watches.in.variables=false
Non-Bundled Plugins: ir.msdehghan.plugins.ansible (0.92), ru.sadv1r.ansible-vault-editor-idea-plugin (1.17), com.jetbrains.ChooseRuntime (1.2), com.jetbrains.jbre.bintray.downloader (2.2), org.zalando.intellij.swagger (1.1.2), com.intellij.ideolog (203.0.27.0), com.jetbrains.plugins.ini4idea (212.5712.51), mobi.hsz.idea.gitignore (4.3.0), com.intellij.kubernetes (212.5712.14), org.asciidoctor.intellij.asciidoc (0.36.13), org.apache.camel (0.8.1), Jetbrains TeamCity Plugin (2021.2.99602), com.jetbrains.upsource (2020.1.1981.11), com.intellij.guice (212.5080.8), com.intellij.jira (3.7.0), GenerateSerialVersionUID (3.0.3), com.codota.csp.intellij (4.2.10), com.jetbrains.php (212.5712.51), com.jetbrains.php.framework (212.5712.14), org.jetbrains.kotlin (212-1.6.10-release-923-IJ5457.46), com.haulmont.jpab (2021.6.2-212), Pythonid (212.5712.43), ru.adelf.idea.dotenv (2022.1), com.github.chencn.yamlandprops (1.0.5)
Kotlin: 212-1.6.10-release-923-IJ5457.46
Current Desktop: ubuntu:GNOME
0

>I have the same issue with unit tests in gradle project. 

The mentioned issue has ben fixed. It was also specific to macOS. You most likely have different problem. Could you please describe exactly your action, what happens after this and what is expected result? Screenshots/screencast would be helpful. Does it happen with specific project only?

Please also attach IDE logs (use Help | Collect Logs and Diagnostic Data action) after reproducing. Thank you.

0

Having same issue with gradle project and latest intellij version 2022.2.2 in Mac OS Monterey Version 12.5.1 in Apple M1 chip.

Though I can debug a normal class but cannot debug unit test.

1

Mohammad Khaer 

Does this workaround help in your case?

If not, please provide additional details as per the comment above. You can upload everything privately to https://uploads.jetbrains.com and provide the upload id here.

0

Arina Efremova

Thank you so much for replying. I had a different cause actually. In Intellij unit test debug settings it was set to gradle. I changed this to Intellij. It works now.

But AWS Lambda code debug does not work. Do you have any workaround for this ? I have set up required things like docker, AWS SAM, AWS profile. Those are okay and unit test debug works. But lambda debug does not work but I can run the actual lambda.

0

Sure, no problem Mohammad Khaer

If you use this plugin, please note that it is developed and maintained by a third party, so any questions or problems with its functionality are best submitted to the plugin's own issue tracker.

0

Hi I am not using this tool for debugging. I just have AWS SAM, docker.

Not sure if this plugin is mandatory to debug AWS lambda.

0

Mohammad Khaer This thread is about IDEA being unable to debug unit tests. Let's keep it that way.

Please submit a new ticket to YouTrack providing all the details regarding your project (structure, frameworks, build tools), the kind of breakpoints you set and their location in code, entire run/debug output if applicable, logs (Help | Show Log in...) and screenshots.

0

Arina Efremova I understand. Just to share with everyone I solved my problem (cannot debug AWS Lambda function). It was due to Apache Camel Intellij plugin. Seems this plugin has conflict with AWS Lambda function debugging. 

I uninstalled the plugin (Apache Camel Intellij plugin). Now I can debug my AWS lambda function in local.

0

I am likely facing the same issue. I am unable to debug JUnit tests. 

My workaround is to use Gradle from the Terminal with the --debug-jvm argument and conducting remote debugging in IntelliJ.

I suspect it might be due to the complexity of the Gradle project I am working on. In much simpler projects, the debugger functions correctly. 

 

IntelliJ IDEA 2023.3.2 (Community Edition)
Build #IC-233.13135.103, built on December 20, 2023
Runtime version: 17.0.9+7-b1087.9 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 4
Non-Bundled Plugins:
 Lombook Plugin (233.13135.65)
Kotlin: 233.13135.103-IJ

0

Armstrong2free hello, do you experience the same issue as described in this ticket?

0

Sergei Riabinin Hello, no, I don't. The cause of my issue was probably related to the Gradle structure of the project which was not correctly loaded into IntelliJ (just my assumption). I tried using the IntelliJ's program execution instead of Gradle execution, and it worked correctly. 

Now, the Gradle debugger from IntelliJ also works correctly. I believe that the ticket https://youtrack.jetbrains.com/issue/IDEA-246330/Autoscroll-Select-Opened-File-does-not-work-for-a-module-thats-in-another-module-which-is-inside-a-group could potentially  contribute to solving the issue, but I am not entirely sure. (Another related ticket: https://intellij-support.jetbrains.com/hc/en-us/community/posts/7163308174866--Select-opened-file-button-does-not-work)

0

Armstrong2free fix for IDEA-246330 should be available on 2024.1 EAP 1, please try

1

Please sign in to leave a comment.