LUCENE-5850: fix smoke tester to verify the index's segment versions in fact match the version being tested

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1614149 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2014-07-28 19:48:09 +00:00
parent b2e631846f
commit 26be35a4a7
3 changed files with 17 additions and 1 deletions

View File

@ -939,7 +939,19 @@ def testDemo(isSrc, version, jdk):
if numHits < 100:
raise RuntimeError('lucene demo\'s SearchFiles found too few results: %s' % numHits)
print(' got %d hits for query "lucene"' % numHits)
print(' checkindex with %s...' % jdk)
run('%s; java -ea -cp "%s" org.apache.lucene.index.CheckIndex index' % (javaExe(jdk), cp), 'checkindex.log')
s = open('checkindex.log').read()
m = re.search(r'^\s+version=(.*?)$', s, re.MULTILINE)
if m is None:
raise RuntimeError('unable to locate version=NNN output from CheckIndex; see checkindex.log')
actualVersion = m.group(1)
if removeTrailingZeros(actualVersion) != removeTrailingZeros(version):
raise RuntimeError('wrong version from CheckIndex: got "%s" but expected "%s"' % (actualVersion, version))
def removeTrailingZeros(version):
return re.sub(r'(\.0)*$', '', version)
def checkMaven(baseURL, tmpDir, svnRevision, version, isSigned):
# Locate the release branch in subversion
m = re.match('(\d+)\.(\d+)', version) # Get Major.minor version components
@ -1274,7 +1286,7 @@ def main():
testArgs = sys.argv[nextArgNum + 1]
nextArgNum += 2
if nextArgNum <= lastArgNum:
isSigned = (sys.argv[nextArgNum] == "True")
isSigned = (sys.argv[nextArgNum].lower() == "true")
nextArgNum += 1
if nextArgNum <= lastArgNum and testArgs == '':
if sys.argv[nextArgNum] == '-testArgs':

View File

@ -148,6 +148,9 @@ API Changes
CoveredBy. The area requirement on the predicates was removed, and Overlaps' definition
was fixed. (David Smiley)
* LUCENE-5850: CheckIndex now prints the Lucene version used to write
each segment. (Robert Muir, Mike McCandless)
Optimizations
* LUCENE-5780: Make OrdinalMap more memory-efficient, especially in case the

View File

@ -536,6 +536,7 @@ public class CheckIndex {
AtomicReader reader = null;
try {
msg(infoStream, " version=" + (version == null ? "3.0" : version));
final Codec codec = info.info.getCodec();
msg(infoStream, " codec=" + codec);
segInfoStat.codec = codec;