Github user dsmiley commented on a diff in the pull request: https://github.com/apache/lucene-solr/pull/422#discussion_r204516946 --- Diff: solr/core/src/test/org/apache/solr/update/processor/TimeRoutedAliasUpdateProcessorTest.java --- @@ -322,6 +327,59 @@ public void testSliceRouting() throws Exception { } } + @Test + public void testPreemptiveCreation() throws Exception { + String configName = TimeRoutedAliasUpdateProcessorTest.configName + getTestName(); + createConfigSet(configName); + + final int numShards = 1 ; + final int numReplicas = 1 ; + CollectionAdminRequest.createTimeRoutedAlias(alias, "2017-10-23T00:00:00Z", "+1DAY", timeField, + CollectionAdminRequest.createCollection("_unused_", configName, numShards, numReplicas) + .setMaxShardsPerNode(numReplicas)).setPreemptiveCreateWindow("3HOUR") + .process(solrClient); + + // cause some collections to be created + assertUpdateResponse(solrClient.add(alias, new SolrInputDocument("id","1","timestamp_dt", "2017-10-25T00:00:00Z"))); + assertUpdateResponse(solrClient.commit(alias)); + + // wait for all the collections to exist... + waitCol("2017-10-23", numShards); + waitCol("2017-10-24", numShards); + waitCol("2017-10-25", numShards); + + // cause some collections to be created + + ModifiableSolrParams params = params(); + assertUpdateResponse(add(alias, Arrays.asList( + sdoc("id", "2", "timestamp_dt", "2017-10-24T00:00:00Z"), --- End diff -- Can you create one or two fewer collections, to thus reduce the overall weight of the test yet still test what we want?
--- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org