Description
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())
Attachments
Attachments
Issue Links
- is related to
-
SOLR-16082 Make SolrTestCaseJ4.initCoreDataDir private
- Open