Fix incorrect test classpath order under the Maven build
--------------------------------------------------------
Key: SOLR-3048
URL: https://issues.apache.org/jira/browse/SOLR-3048
Project: Solr
Issue Type: Bug
Components: Build
Affects Versions: 4.0
Reporter: Steven Rowe
Assignee: Steven Rowe
The {{lucene-test-framework}} test dependency must appear before
{{lucene-core}} in the test classpath, to allow test-only read/write
{{PreFlexRWCodec}} to fulfill Lucene3x codec requests instead of lucene-core's
read-only {{Lucene3xCodec}}.
SOLR-2849 refactored Solr dependencies and pulled the {{lucene-test-framework}}
test dependency into the {{solr-parent}} POM, and all Solr child POMs inherit
that dependency. When a Solr child module e.g. {{solr-core}} runs tests under
Maven, it orders the {{solr-parent}} dependencies *after* its own dependencies
(see [MNG-3494|http://jira.codehaus.org/browse/MNG-3494]), and so
{{lucene-test-framework}} will always appear after {{lucene-core}} if it is
declared in the {{solr-parent}} POM. (I searched the interweb for a mechanism
to influence this ordering, and came up empty-handed...)
Under LUCENE-3490 I [committed a fix to the {{lucene/}} and {{modules/}}
POMs|http://svn.apache.org/viewvc?view=revision&revision=1204732], but not to
any of Solr's POMs - I'm not sure why I excluded Solr at that point :(.
This misconfiguration triggered a [test
failure|https://builds.apache.org/job/Lucene-Solr-Maven-trunk/363/testReport/junit/org.apache.solr.core/TestArbitraryIndexDir/testLoadNewIndexDir/]
today in the Lucene-Solr-Maven-trunk Jenkins build for
{{org.apache.solr.core.TestArbitraryIndexDir.testLoadNewIndexDir}}:
{noformat}
CheckIndex failed
Segments file=segments_1 numSegments=1 version=4.0 format=FORMAT_4_0 [Lucene
4.0]
1 of 1: name=_0 docCount=1
codec=Lucene3x
compound=false
FAILED
WARNING: fixIndex() would remove reference to this segment; full exception:
org.apache.lucene.index.IndexFormatTooNewException: Format version is not
supported (resource:
MockIndexInputWrapper(SimpleFSIndexInput(path="/usr/home/hudson/hudson-slave/workspace/Lucene-Solr-Maven-trunk/checkout/solr/build/solr-maven/test/org.apache.solr.core.TestArbitraryIndexDir-1326913332577/solr/data/index_temp/_0.fnm"))):
-2147483648 (needs to be between -2 and -3)
at
org.apache.lucene.codecs.lucene3x.Lucene3xFieldInfosReader.read(Lucene3xFieldInfosReader.java:71)
...
NOTE: reproduce with: ant test -Dtestcase=TestArbitraryIndexDir
-Dtestmethod=testLoadNewIndexDir
-Dtests.seed=2035db5097855cfe:-1d64b1ca3d5e4ac9:4163b1b8d4ca3ca0
-Dargs="-Dfile.encoding=ISO8859-1"
{noformat}
I was able to reproduce locally using the following cmdline from {{solr/core/}}:
{noformat}
mvn test -Dtest=TestArbitraryIndexDir
-Dtests.seed=2035db5097855cfe:-1d64b1ca3d5e4ac9:4163b1b8d4ca3ca0
-Dfile.encoding=ISO8859-1
{noformat}
The fix is to move the {{lucene-test-framework}} dependency declaration out of
the {{solr-parent}} POM and back into each of the Solr child POMs under which
tests are run.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]