Wednesday, March 6, 2013

Bookmark and Share

Every once in a while it happens to me that TestNG tests fail to launch in Eclipse when starting in debug mode (run mode works fine). The progress bar freezes at 57% and Eclipse indefinitely hangs.

Some googling brought me to to this bug in the TestNG issue tracker. As it seems, the issue is caused by a conflict between the TestNG version used as (Maven) dependency in the project under test and the TestNG version used by the TestNG Eclipse plug-in. People commented at the issue that it helped for them to create a new Eclipse workspace. As I wanted to avoid that, I had a look into the .metadata folder of my workspace, searching for things which might be the potential cause.

And indeed I stumbled upon the folder WORKSPACE_DIR/.metadata/.plugins/org.testng.eclipse/. After deleting this folder and restarting Eclipse, TestNG tests would launch in debug mode again as expected.

6 comments:

Sorencito said...

Tried IntelliJ? :-)

Gunnar Morling said...

Hi Sören,

Yes, maybe I should consider switching to IntelliJ. Actually I'm using it in parallel, but I still like the Eclipse editor a bit better.

Gunnar Morling said...

Hi Sören,

Yes, maybe I should consider switching to IntelliJ. Actually I'm using it in parallel, but I still like the Eclipse editor a bit better.

PeterVermont said...

Thank you for posting. I had this exact problem and your solution worked.

PeterVermont said...

I am on Windows and this solution may only be relevant to this OS.

I had this problem again more recently. I could no longer find an org.testng folder in the plugins folders. I did a search on entire system and found many testng files in user C:\Users\\AppData\Local\Temp. I then used the 'Disk Cleanup' tool to delete all temp files. This fixed the testng in eclipse debug mode hanging.

Paul Mallon said...

Five years later this is still relevant.
Thanks!