简体   繁体   中英

JUnit test debuging hangs in IntelliJ IDEA

During debugging the test code it hangs on the initialization phase. The latest message at the log is (before the debugging hangs):

2013-03-15 13:03:09:215 INFO [ : ] [main:ohdDialect] Using dialect: my.company.package.util.hibernate.HSQLDialect

Please consider the following factors which seems to impact the debugging:

  • Test runs with @RunWith(SpringJUnit4ClassRunner.class)
  • Test run on IntelliJ IDEA 12.0.4
  • When tests run without debugging they works without any problems

What to do to debug the code?

Make sure you did not place a breakpoint on method signature instead of line of regular code. You can recognize such breakpoint also by 4 black dots inside red circle. They slow down debugging dramatically.

Try to remove all breakpoints and restart your Debug. Press Command+Shift+F8, then Command+A and press Del. This if for Mac.

It could easily be that you need to supply the test with more PermGen space.

Try using this in your configurations for that test:

-XX:MaxPermSize=300m 

If your tests aren't insanely huge (and they shouldn't be), this should be more than enough.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM