[
https://issues.apache.org/jira/browse/SOLR-13664?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Hoss Man updated SOLR-13664:
----------------------------
Resolution: Fixed
Fix Version/s: 8.3
master (9.0)
Status: Resolved (was: Patch Available)
> 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
> Fix For: master (9.0), 8.3
>
> Attachments: SOLR-13664.patch, SOLR-13664.patch, SOLR-13664.patch,
> SOLR-13664.patch
>
>
> Prior to Solr 8.3, the javadocs for {{SolrTestCaseJ4.deleteCore()}} said that
> that method would delete the dataDir used by {{initCore()}} in spite of that
> method not actaully doing anything to clean up the dataDir for a very long
> time (exactly when the bug was introduced is not known)
> For that reason, in most solr versions up to and including 8.2, tests that
> called combinations of {{initCore()}} / {{deleteCore()}} within a single test
> class would see the data from a previous core polluting the data of a newly
> introduced core.
> As part of this jira, this bug was fixed, by udpating {{deleteCore()}} to
> "reset" the value of the {{initCoreDataDir}} variable to null, so that it
> can/will be re-initialized on the next call to either {{initCore()}} or the
> lower level {{createCore()}}.
> Existing tests that refer to the {{initCoreDataDir}} directly (either before,
> or during the lifecycle of an active core managed via {{initCore()}} /
> {{deleteCore()}} ) may encounter {{NullPointerExceptions}} on upgrading to
> Solr 8.3 as a result of this bug fix. These tests are encouraged to use the
> new helper method {{initAndGetDataDir()}} in place of directly refering to
> the (now deprecated) {{initCoreDataDir}} variable directly.
> Any existing tests that refer to the {{initCoreDataDir}} directly *after*
> calling {{deleteCore()}} with the intention of inspecting the index contents
> after shutdown, will need to be modified to preserved the rsults of calling
> {{initAndGetDataDir()}} into a new variable for such introspection – the
> actual contents of the directory will not be removed until the full ifecycle
> of the test class is complete (see {{LuceneTestCase.createTempDir()}})
>
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]