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 213502 - ScanUtilsTest and IndexerTransactionTest fail
Summary: ScanUtilsTest and IndexerTransactionTest fail
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 7.2
Hardware: All All
: P2 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords: TEST
Depends on:
Blocks:
 
Reported: 2012-06-04 08:55 UTC by Jiri Skrivanek
Modified: 2012-06-26 03:08 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Proposed patch. (3.79 KB, patch)
2012-06-04 19:35 UTC, Jan Lahoda
Details | Diff
Results with patch. (1.56 MB, application/octet-stream)
2012-06-07 09:08 UTC, Jiri Skrivanek
Details
Results without patch. (1.56 MB, application/octet-stream)
2012-06-07 09:08 UTC, Jiri Skrivanek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Skrivanek 2012-06-04 08:55:27 UTC
Failing tests are part of stable test distribution. Either please fix these test or exclude them from stableBTD test config in project.properties. Test results can be found here

http://hudson4qe.cz.oracle.com/view/Trunk-QE/job/StableBTD-7.2/

Also some test from java.hints is failing. Please, fix as well.
Comment 1 Jan Lahoda 2012-06-04 09:10:21 UTC
Lets start with the java.hints.declarative one, as fixing that may fix the other too as well (they contain similar stack traces). The problem for the j.h.d test is probably that it is invoked incorrectly: it sets "requires.nb.javac=true" inside its nbproject/project.properties, which means it requires our version of javac (API) prepended on the bootclasspath. It simply cannot work without it. So I guess I need precise steps how to build the test distro and how to invoke it, so that I can see how to fix it (the other option is to disable the tests, but that is mostly equivalent to disabling all Java tests on hudson4qe, which seems crazy to me).

Thanks.
Comment 2 Jiri Skrivanek 2012-06-04 09:28:16 UTC
cd /myrepo
ant build-test-dist
ant -f nbbuild/build/testdist -Dnetbeans.dest.dir=/myrepo/nbbuild/netbeans -Dtest.types=unit -Dtest.config=stableBTD

or if you want to run just tests from selected module

ant build-test-dist -Dallmodules=java.hits
ant -f nbbuild/build/testdist -Dnetbeans.dest.dir=/myrepo/nbbuild/netbeans -Dtest.types=unit -Dtest.config=stableBTD -Dmodules.list=java/org-netbeans-modules-java-hints

On hudson, tests run against full daily build with JDK6 and JDK7.
Comment 3 Jan Lahoda 2012-06-04 19:35:40 UTC
Created attachment 120342 [details]
Proposed patch.

A fix for the test distribution that fixes the java.hints.declarative part. May also fix the other two parts, but I don't really have time to test - either Svata will need to take a look, or we will need to wait until hudson4qe runs with this patch applied.

It would be good if the maintainer of the test distro could review, and apply the patch. Alternatively, I can apply it myself, if it is considered to be OK.
Comment 4 Jiri Skrivanek 2012-06-07 09:07:31 UTC
The patch fixes ScanUtilsTest and HintsTaskTest. But other tests in java.hints.infrastructure, java.source.parsing and java.source.usages fail regardless of the patch. I run tests on Windows 7x64, JDK6u33.

ant -f nbbuild/build/testdist -Dnetbeans.dest.dir=D:/hg/main/nbbuild/netbeans -Dtest.config=stableBTD -Dmodules.list=java/org-netbeans-modules-java-source:java/org-netbeans-modules-java-hints:java/org-netbeans-modules-java-hints-declarative -Dtest-sys-prop.ignore.random.failures=true

I agree with applying of proposed patch (do it yourself please) but also look at remaining failures.
Comment 5 Jiri Skrivanek 2012-06-07 09:08:10 UTC
Created attachment 120470 [details]
Results with patch.
Comment 6 Jiri Skrivanek 2012-06-07 09:08:44 UTC
Created attachment 120471 [details]
Results without patch.
Comment 7 Quality Engineering 2012-06-08 06:10:04 UTC
Integrated into 'main-golden', will be available in build *201206080001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/882a8ac0e66d
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #213502: test distro should honor the requires.nb.javac property
Comment 8 Jan Lahoda 2012-06-08 07:20:08 UTC
After the above patch, the tests should be run with out version of nb-javac-api on bootclasspath if appropriate.

One more problem found by Jirka in IndexerTransactionTest is call:
.replaceAll("/", File.separator)
for which the strings are interpreted as the regexp pattern and regexp replacement pattern, respectively. And a string containing only backslash is not a valid regexp replacement pattern, fixing:
http://hg.netbeans.org/main-silver/rev/38cef480d0f6

The test is still failing for me - Tomas please look at it and either fix or disable it. Thanks.
Comment 9 Jiri Skrivanek 2012-06-08 09:10:48 UTC
Please, remove all occurrences of .replaceAll("/", File.separator) in IndexerTransactionTest. It is used in new File(...) and there is not necessary to convert slash to backslash.
Comment 10 Jan Lahoda 2012-06-08 09:18:18 UTC
Sorry - I did not notice there is more than one occurrence of that. Changing the "replaceAll" to "replace" should be sufficient and arguable more correct. If you prefer, I can do that.
Comment 11 Quality Engineering 2012-06-13 06:11:59 UTC
Integrated into 'main-golden', will be available in build *201206130001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/7c22133ea221
User: Jiri Skrivanek <jskrivanek@netbeans.org>
Log: #213502 - Quoting of classpath is needed when IDE is on path with space.
Comment 12 Tomas Zezula 2012-06-14 11:54:40 UTC
The IndexerTransactionTest fixed, at least on my Mac.
Fixed jet-main 0e15941913b3
Comment 13 Quality Engineering 2012-06-15 06:12:13 UTC
Integrated into 'main-golden', will be available in build *201206150001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/0e15941913b3
User: Tomas Zezula <tzezula@netbeans.org>
Log: #213502:ScanUtilsTest and IndexerTransactionTest fail
Comment 14 Jiri Skrivanek 2012-06-18 07:17:20 UTC
I verified it in trunk. Please, transplant changeset 0e15941913b3 to release72 branch. AFAIK, high-resistance process doesn't apply to tests, so please proceed without review.
Comment 15 Jan Lahoda 2012-06-19 15:49:54 UTC
I agree with adding the changeset into the release72 branch.
Comment 16 Tomas Zezula 2012-06-21 12:02:17 UTC
Transplanted into release 7.2: releases ab89d58522e1
Comment 17 Quality Engineering 2012-06-22 04:21:43 UTC
Integrated into 'releases', will be available in build *201206212341* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/ab89d58522e1
User: Tomas Zezula <tzezula@netbeans.org>
Log: #213502:ScanUtilsTest and IndexerTransactionTest fail
Comment 18 Jiri Skrivanek 2012-06-25 07:18:05 UTC
IndexerTransactionTest is still failing on Solaris, so I excluded it in release72 branch. Other tests passed.
Comment 19 Quality Engineering 2012-06-26 03:08:00 UTC
Integrated into 'releases', will be available in build *201206252201* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/793db6d2b68a
User: Jiri Skrivanek <jskrivanek@netbeans.org>
Log: #213502 - Excluding test failing on Solaris.