[ 
https://issues.apache.org/jira/browse/SOLR-13664?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16899695#comment-16899695
 ] 

ASF subversion and git services commented on SOLR-13664:
--------------------------------------------------------

Commit ab470a6564b1184c2d77892131f56a9912f7d8c6 in lucene-solr's branch 
refs/heads/SOLR-13105-visual from Chris M. Hostetter
[ https://gitbox.apache.org/repos/asf?p=lucene-solr.git;h=ab470a6 ]

SOLR-13664: Fixed SolrTestCaseJ4.deleteCore() to properly reset the dataDir 
used by initCore()


>  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: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to