Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 28895 invoked from network); 20 Nov 2006 23:28:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Nov 2006 23:28:31 -0000 Received: (qmail 42004 invoked by uid 500); 20 Nov 2006 23:28:35 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 41954 invoked by uid 500); 20 Nov 2006 23:28:35 -0000 Mailing-List: contact java-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-dev@lucene.apache.org Received: (qmail 41917 invoked by uid 99); 20 Nov 2006 23:28:35 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Nov 2006 15:28:35 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Nov 2006 15:28:24 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 88F3A714317 for ; Mon, 20 Nov 2006 15:28:04 -0800 (PST) Message-ID: <25730016.1164065284558.JavaMail.jira@brutus> Date: Mon, 20 Nov 2006 15:28:04 -0800 (PST) From: "Michael Busch (JIRA)" To: java-dev@lucene.apache.org Subject: [jira] Updated: (LUCENE-720) Unit tests TestBackwardsCompatibility and TestIndexFileDeleter might fail depending on JVM In-Reply-To: <24077892.1164065282526.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ http://issues.apache.org/jira/browse/LUCENE-720?page=all ] Michael Busch updated LUCENE-720: --------------------------------- Environment: Windows XP, IBM JVM 1.5 SP3 > Unit tests TestBackwardsCompatibility and TestIndexFileDeleter might fail depending on JVM > ------------------------------------------------------------------------------------------ > > Key: LUCENE-720 > URL: http://issues.apache.org/jira/browse/LUCENE-720 > Project: Lucene - Java > Issue Type: Bug > Components: Index > Affects Versions: 2.1 > Environment: Windows XP, IBM JVM 1.5 SP3 > Reporter: Michael Busch > Assigned To: Michael McCandless > Priority: Minor > > In the two units tests TestBackwardsCompatibility and TestIndexFileDeleter several index file names are hardcoded. For example, in TestBackwardsCompatibility.testExactFileNames() it is tested if the index directory contains exactly the expected files after several operations like addDocument(), deleteDocument() and setNorm() have been performed. Apparently the unit tests pass on the nightly build machine, but in my environment (Windows XP, IBM JVM 1.5) they fail for the following reason: > When IndexReader.setNorm() is called a new norm file for the specified field is created with the file ending .sx, where x is the number of the field. The problem is that the SegmentMerger can not guarantee to keep the order of the fields, in other words after a merge took place a field can have a different field number. This specific testcase fails, because it expects the file ending .s0, but the file has the ending .s1. > The reason why the field numbers can be different on different JVMs is the use of HashSet in SegmentReader.getFieldNames(). Depending on the HashSet implementation an iterator might not iterate over the entries in insertion order. When I change HashSet to LinkedHashSet, the two testcases pass. > However, even with a LinkedHashSet the order of the field numbers might change during a merge, because the order in which the SegmentMerger merges the FieldInfos depends on the field options like TERMVECTOR, INDEXED... (see SegmentMerger.mergeFields() for details). > So I think we should not use LinkedHashSet but rather change the problematic testcases. Furthermore I'm not sure if we should have hardcoded filenames in the tests anyway, because if we change the index format or file names in the future these test cases would fail without modification. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org