Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 270076 - Compile on save must finish before other action is invoked
Compile on save must finish before other action is invoked
Product: java
Classification: Unclassified
Component: Project
PC Linux
: P2 (vote)
: Dev
Assigned To: Tomas Zezula
Depends on:
  Show dependency treegraph
Reported: 2017-03-15 15:05 UTC by Jaroslav Tulach
Modified: 2017-05-16 01:43 UTC (History)
0 users

See Also:
Issue Type: DEFECT


Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2017-03-15 15:05:52 UTC
I am using using truffle sources with mx netbeansinit:

I have realized that in current version ( and it takes a lot of time to run a unit test. The long time is especially caused by building the project that contains the test first and only then running it.

But that shouldn't be necessary! The projects have compile-on-save feature enabled, and as such there is no need to compile them again from the command line. Thus I tried to disable that by:

mx$ git diff
diff --git a/ b/
index 604b5a7..a85e2ab 100755
--- a/
+++ b/
@@ -12199,7 +12199,7 @@ def _netbeansinit_project(p, jdks=None, files=None, libFiles=None, dists=None):
     out.element('target', {'name' : 'test', 'depends' : 'run'})
     out.element('target', {'name' : 'test-single', 'depends' : 'run'})
-'target', {'name' : 'run', 'depends' : 'compile'})
+'target', {'name' : 'run'})
     out.element('property', {'name' : 'test.class', 'value' :})'exec', {'executable' : sys.executable, 'failonerror' : 'true', 'dir' : execDir})
     out.element('env', {'key' : 'JAVA_HOME', 'value' : jdk.home})
@@ -12209,7 +12209,7 @@ def _netbeansinit_project(p, jdks=None, files=None, libFiles=None, dists=None):
     out.element('target', {'name' : 'debug-test', 'depends' : 'debug'})
-'target', {'name' : 'debug', 'depends' : 'init,compile'})
+'target', {'name' : 'debug', 'depends' : 'init'})
     out.element('property', {'name' : 'test.class', 'value' :})'nbjpdastart', {'addressproperty' : 'jpda.address', 'name' :})'classpath')

This certainly speeds things up. If I select a test file and run it - it starts very quickly.

However there is a problem: If I make modifications and press "Shift-F6", the test is executed - but not with my code in - with the previously saved version.

The problem is that now the "Run Test" actions is as quick that it starts sooner than the CoS manages to save the file. That hurts usability quite a lot.

On the other hand the speed up caused by skipping the compilation step when running a test is significant. I'd like to keep it. There is one solution that comes to my mind: could the IDE delay any Ant invocations on the project before previously scheduled save operations are finished?
Comment 1 Tomas Zezula 2017-05-15 08:58:23 UTC
Fixed jet-main d3f9517f406f
Comment 2 Quality Engineering 2017-05-16 01:43:15 UTC
Integrated into 'main-silver', will be available in build *201705160001* on (upload may still be in progress)

User: Tomas Zezula <>
Log: #270076:Compile on save must finish before other action is invoked

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo