You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Hoss Man (JIRA)" <ji...@apache.org> on 2019/07/30 18:28:00 UTC

[jira] [Updated] (SOLR-13664) SolrTestCaseJ4.deleteCore() does not delete/clean dataDir

     [ https://issues.apache.org/jira/browse/SOLR-13664?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hoss Man updated SOLR-13664:
----------------------------
    Attachment: SOLR-13664.patch
        Status: Open  (was: Open)

The attached patch doesn't fix the problem – still thinking about the best solution to move forward – but it does trivially demonstrates this problem in a new test. It also updates {{TestUseDocValuesAsStored}} to include a sanity check against this problem.
----
A weird {{TestUseDocValuesAsStored}} jenkins failure is how i discovered this in the first place...

apache_Lucene-Solr-Tests-8.2_34.log.txt
{noformat}
   [junit4]   2> NOTE: reproduce with: ant test  -Dtestcase=TestUseDocValuesAsStored -Dtests.method=testDuplicateMultiValued -Dtests.seed=69AC8730651B9CCD -Dtests.multiplier=2 -Dtests.slow=true -Dtests.locale=ja -Dtests.timezone=America/Argentina/ComodRivadavia -Dtests.asserts=true -Dtests.file.encoding=UTF-8
   [junit4] ERROR   1.13s J0 | TestUseDocValuesAsStored.testDuplicateMultiValued <<<
   [junit4]    > Throwable #1: java.lang.RuntimeException: Exception during query
   [junit4]    >        at __randomizedtesting.SeedInfo.seed([69AC8730651B9CCD:87719310ABAA6A71]:0)
   [junit4]    >        at org.apache.solr.SolrTestCaseJ4.assertQ(SolrTestCaseJ4.java:947)
   [junit4]    >        at org.apache.solr.schema.TestUseDocValuesAsStored.doTest(TestUseDocValuesAsStored.java:367)
   [junit4]    >        at org.apache.solr.schema.TestUseDocValuesAsStored.testDuplicateMultiValued(TestUseDocValuesAsStored.java:172)
   [junit4]    >        at java.lang.Thread.run(Thread.java:748)
   [junit4]    > Caused by: java.lang.RuntimeException: REQUEST FAILED: xpath=//arr[@name='enums_dvo']/str[.='Not Available']
   [junit4]    >        xml response was: <?xml version="1.0" encoding="UTF-8"?>
   [junit4]    > <response>
   [junit4]    > <lst name="responseHeader"><int name="status">0</int><int name="QTime">0</int></lst><result name="response" numFound="11" start="0"><doc><str name="id">xyz</str></doc><doc><str name="id">myid</str></doc><doc><str name="id">1</str><arr name="test_ss_dvo"><str>X</str><str>Y</str></arr></doc><doc><str name="id">2</str><arr name="test_ss_dv"><str>X</str><str>X</str><str>Y</str></arr></doc><doc><str name="id">3</str><arr name="test_ss_dvo2"><str>X</str><str>Y</str></arr></doc><doc><str name="id">4</str><arr name="test_is_dvo"><int>-666</int><int>42</int><int>42</int></arr></doc><doc><str name="id">5</str><arr name="test_fs_dvo"><float>-66.666</float><float>4.2</float><float>4.2</float></arr></doc><doc><str name="id">6</str><arr name="test_ls_dvo"><long>-6666666</long><long>420</long><long>420</long></arr></doc><doc><str name="id">7</str><arr name="test_ds_dvo"><double>-6.6666E-5</double><double>0.0042</double><double>0.0042</double></arr></doc><doc><str name="id">8</str><arr name="test_dts_dvo"><date>1999-12-31T23:59:59Z</date><date>2016-07-04T03:02:01Z</date><date>2016-07-04T03:02:01Z</date></arr></doc></result>
   [junit4]    > </response>
   [junit4]    >        request was:q=*:*&fl=*&wt=xml
   [junit4]    >        at org.apache.solr.SolrTestCaseJ4.assertQ(SolrTestCaseJ4.java:940)

{noformat}
...what's happening here is that docs from previous test methods in this class (that should have been using their own distinct cores + dataDirs) are bleeding into this test, causing the doc the test is checking for in to be pushed out past the {{rows=10}} results. (note the {{numFound="11"}})

>  SolrTestCaseJ4.deleteCore() does not delete/clean dataDir
> ----------------------------------------------------------
>
>                 Key: SOLR-13664
>                 URL: https://issues.apache.org/jira/browse/SOLR-13664
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Hoss Man
>            Assignee: Hoss Man
>            Priority: Major
>         Attachments: SOLR-13664.patch
>
>
> In spite of what it's javadocs say, {{SolrTestCaseJ4.deleteCore()}} does nothing to delete the dataDir used by the TestHarness
> The git history is a bit murky, so i'm not entirely certain when this stoped working, but I suspect it happened as part of the overall cleanup regarding test temp dirs and the use of {{LuceneTestCase.createTempDir(...) -> TestRuleTemporaryFilesCleanup}}
> While this is not problematic in many test classes, where a single {{initCore(...) is called in a {{@BeforeClass}} and the test then re-uses that SolrCore for all test methods and relies on {{@AfterClass SolrTestCaseJ4.teardownTestCases()}} to call {{deleteCore()}}, it's problematic in test classes where {{deleteCore()}} is explicitly called in an {{@After}} method to ensure a unique core (w/unique dataDir) is used for each test method.
> (there are currently about 61 tests that call {{deleteCore()}} directly)



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org