noblepaul commented on code in PR #1350:
URL: https://github.com/apache/solr/pull/1350#discussion_r1104037790
##########
solr/core/src/test/org/apache/solr/cloud/SplitShardWithNodeRoleTest.java:
##########
@@ -0,0 +1,91 @@
+package org.apache.solr.cloud;
+
+import java.util.Locale;
+import org.apache.solr.client.solrj.impl.CloudSolrClient;
+import org.apache.solr.client.solrj.request.CollectionAdminRequest;
+import org.apache.solr.client.solrj.request.UpdateRequest;
+import org.apache.solr.common.SolrInputDocument;
+import org.apache.solr.core.NodeRoles;
+import org.apache.solr.embedded.JettySolrRunner;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class SplitShardWithNodeRoleTest extends SolrCloudTestCase {
+ @BeforeClass
+ public static void setupCluster() throws Exception {
+ configureCluster(2).addConfig("conf",
configset("cloud-minimal")).configure();
+ System.setProperty(NodeRoles.NODE_ROLES_PROP, "data:off,coordinator:on");
+
+ try {
+ cluster.startJettySolrRunner();
+ cluster.startJettySolrRunner();
+ } finally {
+ System.clearProperty(NodeRoles.NODE_ROLES_PROP);
+ }
+
+ JettySolrRunner overseer1 = null;
+ JettySolrRunner overseer2 = null;
+ System.setProperty(NodeRoles.NODE_ROLES_PROP,
"data:off,overseer:preferred");
+ try {
+ overseer1 = cluster.startJettySolrRunner();
+ overseer2 = cluster.startJettySolrRunner();
+ } finally {
+ System.clearProperty(NodeRoles.NODE_ROLES_PROP);
+ }
+
+ Thread.sleep(10000);
Review Comment:
We can't have a test waiting for 10 seconds. it should exit the wait as soon
as the conditions are met
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]