Github user andyetitmoves commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/121#discussion_r22386987
  
    --- Diff: 
solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java 
---
    @@ -861,23 +877,107 @@ protected void compareResponses(QueryResponse a, 
QueryResponse b) {
         compareSolrResponses(a, b);
       }
     
    -  @Test
    -  public void testDistribSearch() throws Exception {
    -    if (fixShardCount) {
    -      createServers(shardCount);
    -      RandVal.uniqueValues = new HashSet(); //reset random values
    -      doTest();
    -      destroyServers();
    -    } else {
    -      for (int nServers = 1; nServers < shardCount; nServers++) {
    -        createServers(nServers);
    +  @Retention(RetentionPolicy.RUNTIME)
    +  @Target(ElementType.METHOD)
    +  public @interface ShardsRepeat {
    +    public abstract int min() default 1;
    +    public abstract int max() default DEFAULT_MAX_SHARD_COUNT;
    +  }
    +
    +  @Retention(RetentionPolicy.RUNTIME)
    +  @Target(ElementType.METHOD)
    +  public @interface ShardsFixed {
    +    public abstract int num();
    +  }
    +
    +  public class ShardsRepeatRule implements TestRule {
    +
    +    private abstract class ShardsStatement extends Statement {
    +      abstract protected void callStatement() throws Throwable;
    +
    +      @Override
    +      public void evaluate() throws Throwable {
    +        distribSetUp();
    --- End diff --
    
    To some extent I guess, what this does though is in most cases ensures the 
entire chain is called (and not just this {{distribSetUp}}), and there are 
quite a few abstract sub-classes for this which would want them to be called as 
well. There are ways to subvert that still, but at  least this protects against 
a simple {{super.distribSetUp()}} not being called..


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to