This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 210726 - unit tests in a maven project hang
Summary: unit tests in a maven project hang
Status: RESOLVED DUPLICATE of bug 211005
Alias: None
Product: projects
Classification: Unclassified
Component: Ant (show other bugs)
Version: 7.2
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks: 208213
  Show dependency tree
 
Reported: 2012-04-04 18:48 UTC by devon_c_miller
Modified: 2012-05-21 17:53 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Thread dump with test file hang (20.79 KB, text/plain)
2012-04-04 18:48 UTC, devon_c_miller
Details

Note You need to log in before you can comment on or make changes to this bug.
Description devon_c_miller 2012-04-04 18:48:12 UTC
Created attachment 117836 [details]
Thread dump with test file hang

NetBeans Dev 201203260401

I have a maven project and if I select "Build" or "Test" from the Project context menu, it works fine.

However, if while editing the unit test, I press Ctrl-F6 (Test File), the test never starts and the status bar shows "myproject (test)" and a progress bar that never moves.

If I save the file, then press Ctrl-F6, it works. 
But, if I don't explicitly save the file, it will hang every time.

I'm attaching a thread dump taken when the test is hung.
Comment 1 Tomas Zezula 2012-04-10 13:11:34 UTC
It's not a good idea to call:
IndexingManager.refreshIndexAndWait (wait until scan task finishes)
from:
 IndexingManager.runProtected which blocks scans.
Comment 2 Jesse Glick 2012-04-10 15:17:21 UTC
The project may be Maven-based, but the stack trace shows a unit test running in Compile on Save mode using Ant.

(In reply to comment #1)
> It's not a good idea to call:
> IndexingManager.refreshIndexAndWait (wait until scan task finishes)
> from:
>  IndexingManager.runProtected which blocks scans.

How can this be avoided? The whole Ant process is wrapped in runProtected.
Comment 3 Jesse Glick 2012-04-10 15:18:14 UTC
Reassigning for evaluation; unclear if bug is actually in BuildArtifactMapperImpl.ensureBuilt.
Comment 4 Jesse Glick 2012-05-09 20:53:19 UTC
Possibly a duplicate of bug #211005; can this still be reproduced in dev builds? (I do not think I ever managed to reproduce it myself.)
Comment 5 devon_c_miller 2012-05-21 17:06:40 UTC
I cannot reproduce it with the latest dev build (201205070400).
Comment 6 Jesse Glick 2012-05-21 17:53:28 UTC
Then guessing it is a duplicate.

*** This bug has been marked as a duplicate of bug 211005 ***