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

Hoss Man commented on SOLR-9934:
--------------------------------

There might be *some* places where delQ could/should be replaced with 
cleraIndex based on the *intent* of the call, but it shouldn't really be 
causing any _correctness_ issues.

* if a test is doing a delQ to simulate an external user doing a delQ then 
that's a valid and correct usage.
* if a test is doing a delQ to "reset" test state to emulate a completely 
pristine solr collection, that's where cleraIndex is (now) a better choice.

For 99% of all tests the diff is academic, but places where there *is* a diff 
are when tests muck with version numbers synthetically (ie: the original reason 
for this special syntax), have very specific assumptions about low level 
internal term stats (ie: the new updatable doc values tests, or perhaps some 
luke-esque tests) etc...

if you think there are tests that would be improved by switching from delQ to 
clearIndex in their test scafolding (ie: in Before/After methods, or when 
reseting some state) then sure -- go ahead and open a new issue for those.  But 
tests that do "normal" user requests, and do "normal" delq(matchalldocs) as 
part of that are just fine and certainly don't need .changed


> SolrTestCase.clearIndex should ensure IndexWriter.deleteAll is called
> ---------------------------------------------------------------------
>
>                 Key: SOLR-9934
>                 URL: https://issues.apache.org/jira/browse/SOLR-9934
>             Project: Solr
>          Issue Type: Test
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Hoss Man
>            Assignee: Hoss Man
>             Fix For: master (7.0), 6.4
>
>         Attachments: SOLR-9934.patch
>
>
> Normal deleteByQuery commands are subject to version constraint checks due to 
> the possibility of out of order updates, but DUH2 has special support 
> (triggered by {{version=-Long.MAX_VALUE}} for use by tests to override these 
> version constraints and do a low level {{IndexWriter.deleteAll()}} call.  A 
> handful of tests override {{SolrTestCaseJ4.clearIndex()}} to take advantage 
> of this (using copy/pasted impls), but given the intended purpose/usage of 
> {{SolrTestCaseJ4.clearIndex()}}, it seems like the the base method in 
> {{SolrTestCaseJ4}} should itself trigger this low level deletion, so tests 
> get this behavior automatically.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to