apache / lucene

Apache Lucene open-source search software
https://lucene.apache.org/
Apache License 2.0
2.45k stars 975 forks source link

Fix test failure TestDocumentsImpl.testGetDocumentFields #13303

Closed easyice closed 2 months ago

easyice commented 2 months ago

This test relies on the order of reading the store fields being consistent with the writing order, This change disable the MockRandomMergePolicy for consistency.

./gradlew test --tests TestDocumentsImpl.testGetDocumentFields -Dtests.seed=6AC235CCDD415BC4 -Dtests.nightly=true -Dtests.locale=ceb-Latn-PH -Dtests.timezone=Africa/Djibouti -Dtests.asserts=true -Dtests.file.encoding=UTF-8
   >     org.junit.ComparisonFailure: expected:<[Pride and Prejudice]> but was:<[The Adventures of Sherlock Holmes]>
   >         at __randomizedtesting.SeedInfo.seed([6AC235CCDD415BC4:F5CFD3BF14408724]:0)
   >         at junit@4.13.1/org.junit.Assert.assertEquals(Assert.java:117)
   >         at junit@4.13.1/org.junit.Assert.assertEquals(Assert.java:146)
   >         at org.apache.lucene.luke.models.documents.TestDocumentsImpl.testGetDocumentFields(TestDocumentsImpl.java:65)
easyice commented 2 months ago

This PR will also fix failure TestDocumentsImpl.testNextTermDoc

org.apache.lucene.luke.models.documents.TestDocumentsImpl > testNextTermDoc FAILED
    java.lang.AssertionError: expected:<4> but was:<3>
        at __randomizedtesting.SeedInfo.seed([14863184E4694773:1EBE0601981AC1B4]:0)
        at junit@4.13.1/org.junit.Assert.fail(Assert.java:89)
        at junit@4.13.1/org.junit.Assert.failNotEquals(Assert.java:835)
        at junit@4.13.1/org.junit.Assert.assertEquals(Assert.java:647)
        at junit@4.13.1/org.junit.Assert.assertEquals(Assert.java:633)
        at org.apache.lucene.luke.models.documents.TestDocumentsImpl.testNextTermDoc(TestDocumentsImpl.java:206)
./gradlew test --tests TestDocumentsImpl.testNextTermDoc -Dtests.seed=14863184E4694773 -Dtests.nightly=true
easyice commented 2 months ago

@benwtrent Thank you for reviewing!