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 93777 - JUnit diff endless loop in tests
Summary: JUnit diff endless loop in tests
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: NB JUnit (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: ehucka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-01 10:53 UTC by Marek Fukala
Modified: 2009-09-29 22:19 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marek Fukala 2007-02-01 10:53:40 UTC
I have encountered a problem with netbeans junit diff implementation recently.
If you run html/editor/lib tests by xtest the tests will lock and never finish.
The problem seems to be in the diff implementation which stays in an endless loop.

"main" prio=1 tid=0x09659368 nid=0x743c runnable [0xbfa00000..0xbfa01548]
        at java.util.ArrayList.indexOf(ArrayList.java:220)
        at java.util.ArrayList.contains(ArrayList.java:201)
        at org.netbeans.junit.diff.LineDiff.diff(LineDiff.java:172)
        at org.netbeans.junit.diff.SimpleDiff.textualCompare(SimpleDiff.java:119)
        at org.netbeans.junit.diff.SimpleDiff.diff(SimpleDiff.java:56)
        at org.netbeans.junit.NbTestCase.assertFile(NbTestCase.java:474)
        at org.netbeans.junit.NbTestCase.assertFile(NbTestCase.java:511)
        at org.netbeans.junit.NbTestCase.compareReferenceFiles(NbTestCase.java:981)
        at org.netbeans.junit.NbTestCase.compareReferenceFiles(NbTestCase.java:993)
        at
org.netbeans.editor.ext.html.HTMLSyntaxSupportTest.testSyntaxElementsForEveryPositionInDocument(HTMLSyntaxSupportTest.java:95)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at junit.framework.TestCase.runTest(TestCase.java:164)
        at org.netbeans.junit.NbTestCase.access$200(NbTestCase.java:59)
        at org.netbeans.junit.NbTestCase$2.doSomething(NbTestCase.java:285)
        at org.netbeans.junit.NbTestCase$1Guard.run(NbTestCase.java:223)
        at org.netbeans.junit.NbTestCase.runBare(NbTestCase.java:301)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:120)
        at org.netbeans.junit.NbTestCase.run(NbTestCase.java:164)
        at junit.framework.TestSuite.runTest(TestSuite.java:230)
        at junit.framework.TestSuite.run(TestSuite.java:225)
        at
org.netbeans.xtest.testrunner.JUnitTestRunner.runTests(JUnitTestRunner.java:169)
        at
org.netbeans.xtest.testrunner.JUnitTestRunner.runTests(JUnitTestRunner.java:124)
        at
org.netbeans.xtest.plugin.jvm.JUnitTestRunnerLauncher.main(JUnitTestRunnerLauncher.java:60)
Comment 1 ehucka 2007-02-01 15:19:19 UTC
Could you specify which test fails or what data are compared there?
thanks
Comment 2 ehucka 2007-02-02 12:42:40 UTC
I found out e.g. HTMLCompletionQueryTest always ends by OutOfMemoryError before
test results comparision on my machine. So I cannot generate ref file to
reproduce the issue. Could you send me generated ref files of this test? (Start
the test with disabled comparision of results)
Comment 3 Marian Petras 2007-02-02 22:33:38 UTC
Changed 'component' and 'subcomponent' to 'xtest/nbjunit'.
Comment 4 Marek Fukala 2007-02-05 10:11:47 UTC
IMHO the result file must be on the testing machines where the tests are always
time-outed.
Comment 5 ehucka 2007-02-05 21:24:38 UTC
Rewritten diff algorithm.

Checking in test/unit/src/org/netbeans/junit/diff/LineDiffTest.java;
/cvs/xtest/nbjunit/test/unit/src/org/netbeans/junit/diff/LineDiffTest.java,v 
<--  LineDiffTest.java
new revision: 1.3; previous revision: 1.2

Checking in src/org/netbeans/junit/diff/LineDiff.java;
/cvs/xtest/nbjunit/src/org/netbeans/junit/diff/LineDiff.java,v  <--  LineDiff.java
new revision: 1.19; previous revision: 1.18