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.
Created attachment 93623 [details] thread dump Sometimes CND test are hung on: org.openide.text.CloneableEditorSupport.openDocumentImpl(CloneableEditorSupport.java:867) I see some lack of class design: - lock does not final. It may be root of problem.
Implementation of org.netbeans.junit.NbTestCase$1Guard.waitFinished(NbTestCase.java:304) does not guarantee of needed waiting. So on Mac test case can be terminated after arbitrary time interval. For example output of test case with overridden timeOut() protected int timeOut() { return 500000; } Log show that test case was terminated after 3 seconds: --------------------------------- [junit] ------------- Standard Error ----------------- [junit] Start testPkgConfig at Mon Feb 01 14:35:26 MSK 2010 [junit] Found required tool: gzip=/usr/bin/gzip [junit] Found required tool: rm=/bin/rm [junit] Found required tool: tar=/usr/bin/tar [junit] Found required tool: wget=/Users/tester/bin/wget [junit] End testPkgConfig at Mon Feb 01 14:35:29 MSK 2010 [junit] ------------- ---------------- --------------- [junit] Testcase: testPkgConfig(org.netbeans.modules.cnd.discovery.project.cases.PkgConfigTestCase): FAILED [junit] The test testPkgConfig did not finish in 500000ms [junit] Group system [junit] Group main [junit] Thread main [junit] at java.lang.Thread.dumpThreads(Thread.java:-2) [junit] at java.lang.Thread.getAllStackTraces(Thread.java:1511) [junit] at org.netbeans.junit.NbTestCase.threadDump(NbTestCase.java:247) [junit] at org.netbeans.junit.NbTestCase.access$000(NbTestCase.java:89) [junit] at org.netbeans.junit.NbTestCase$1Guard.waitFinished(NbTestCase.java:304) [junit] at org.netbeans.junit.NbTestCase.runBare(NbTestCase.java:362) [junit] at junit.framework.TestResult$1.protect(TestResult.java:110) [junit] at junit.framework.TestResult.runProtected(TestResult.java:128) [junit] at junit.framework.TestResult.run(TestResult.java:113) [junit] at junit.framework.TestCase.run(TestCase.java:124) [junit] at org.netbeans.junit.NbTestCase.run(NbTestCase.java:214) [junit] at junit.framework.TestSuite.runTest(TestSuite.java:232) [junit] at junit.framework.TestSuite.run(TestSuite.java:227) [junit] at junit.framework.TestSuite.runTest(TestSuite.java:232) [junit] at junit.framework.TestSuite.run(TestSuite.java:227) [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:421) [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:912) [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:766) .............
So, the issue is with wait(time); without any while(condition) checks 'wait(timeout)' doesn't wait for the "timeout". It only prevents waiting "longer than 'timeout'" while JVM can wake up you anytime
proposed fix: http://hg.netbeans.org/cnd-main/rev/c7780d068ca2 Sorry for changing code, I cannot verify fix on build machines without pushing.
It seems problem was fixed.
Fix sounds right, thanks. Do nbjunit module tests pass with the change? (Is it feasible to write a test for this fix?)
Yes, nbjunit module tests are passed. I do not know how to create test for fix because: - Mac specific bug (cnd run tests on 7 platforms, other platforms do not have such bug). - repeatability is: 1/4000 tests or 1 bug on 1 hour testing.
Integrated into 'main-golden', will be available in build *201002040200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/c7780d068ca2 User: Alexander Simon <alexvsimon@netbeans.org> Log: fixing BZ#179946 NbTestCase violates contract of method timeOut()