Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,6 @@ public void testThatCantForwardToLeaderFails() throws Exception {
// create a new node for the purpose of killing it...
final JettySolrRunner leaderToPartition = cluster.startJettySolrRunner();
try {
cluster.waitForNode(leaderToPartition, DEFAULT_TIMEOUT);

// HACK: we have to stop the node in order to enable the proxy, in order to then restart the
// node
// (in order to then "partition it" later via the proxy)
Expand All @@ -451,7 +449,6 @@ public void testThatCantForwardToLeaderFails() throws Exception {
try {
log.info("leaderToPartition's Proxy: {}", proxy);

cluster.waitForNode(leaderToPartition, DEFAULT_TIMEOUT);
// create a 2x1 collection using a nodeSet that includes our leaderToPartition...
assertEquals(
RequestStatusState.COMPLETED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ public void testPeersyncFailureReplicationSuccess() throws Exception {
ZkStateReader.from(solrClient).registerCollectionStateWatcher(collectionName, stateWatcher);

JettySolrRunner newNode = cluster.startJettySolrRunner();
cluster.waitForAllNodes(30);
CollectionAdminRequest.addReplicaToShard(collectionName, "shard1")
.setNode(newNode.getNodeName())
.process(solrClient);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,6 @@ public static void checkClusterWithCollectionCreations(

// create a new server
JettySolrRunner startedServer = cluster.startJettySolrRunner();
cluster.waitForAllNodes(30);
assertTrue(startedServer.isRunning());
assertEquals(NUM_SERVERS, cluster.getJettySolrRunners().size());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ public void testCollectionCreateSearchDelete() throws Exception {

// create a server
JettySolrRunner startedServer = cluster.startJettySolrRunner();
cluster.waitForAllNodes(30);
assertTrue(startedServer.isRunning());
assertEquals(nodeCount, cluster.getJettySolrRunners().size());

Expand Down Expand Up @@ -162,7 +161,6 @@ public void testCollectionCreateSearchDelete() throws Exception {

// re-create a server (to restore original nodeCount count)
startedServer = cluster.startJettySolrRunner(jettyToStop);
cluster.waitForAllNodes(30);
assertTrue(startedServer.isRunning());
assertEquals(nodeCount, cluster.getJettySolrRunners().size());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ public void testEvents() throws Exception {
// NODES_UP
eventsListener.setExpectedType(ClusterEvent.EventType.NODES_UP);
JettySolrRunner newNode = cluster.startJettySolrRunner();
cluster.waitForNode(newNode, 60);
eventsListener.waitForExpectedEvent(30);
assertNotNull(
"should be NODES_UP events", eventsListener.events.get(ClusterEvent.EventType.NODES_UP));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public void testCloudClientCanConnectAfterClusterComesUp() throws Exception {
e.getMessage().contains("cluster not found/not ready"));

cluster.startJettySolrRunner();
cluster.waitForAllNodes(30);
client.connect(20, TimeUnit.SECONDS);

// should work now!
Expand Down Expand Up @@ -77,7 +76,6 @@ public void testCloudClientUploads() throws Exception {
e.getMessage().contains("cluster not found/not ready"));

cluster.startJettySolrRunner();
cluster.waitForAllNodes(30);
client.connect(20, TimeUnit.SECONDS);

cluster.getZkClient().upConfig(configPath, "testconfig");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,6 @@ private void doTestCollectionWatchWithNodeShutdown(final boolean shutdownUnusedN
shutdownUnusedNode ? extraJetty : cluster.getJettySolrRunners().get(0);
final int expectedNodesWithActiveReplicas = CLUSTER_SIZE - (shutdownUnusedNode ? 0 : 1);

cluster.waitForAllNodes(MAX_WAIT_TIMEOUT);

// shutdown a node and check that we get notified about the change
final CountDownLatch latch = new CountDownLatch(1);
ZkStateReader.from(client)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,9 @@ public JettySolrRunner getJettySolrRunner(int index) {
}

/**
* Start a new Solr instance on a particular servlet context
* Start a new Solr instance on a particular servlet context. Waits for the node to appear in
* cluster live nodes before returning (unless called during initial cluster construction, in
* which case the constructor's own {@link #waitForAllNodes} handles this).
*
* @param name the instance name
* @param config a JettyConfig for the instance's {@link org.apache.solr.embedded.JettySolrRunner}
Expand Down Expand Up @@ -500,11 +502,17 @@ public JettySolrRunner startJettySolrRunner(String name, JettyConfig config, Str
synchronized (startupWait) {
startupWait.notifyAll();
}
// solrClient is null during the initial parallel cluster startup in the constructor;
// in that case the constructor's waitForAllNodes call handles node synchronization.
if (solrClient != null) {
waitForNode(jetty, DEFAULT_TIMEOUT);
}
return jetty;
}

/**
* Start a new Solr instance, using the default config
* Start a new Solr instance, using the default config. Waits for the node to appear in cluster
* live nodes before returning.
*
* @return a JettySolrRunner
*/
Expand All @@ -513,7 +521,8 @@ public JettySolrRunner startJettySolrRunner() throws Exception {
}

/**
* Add a previously stopped node back to the cluster on a different port
* Add a previously stopped node back to the cluster on a different port. Waits for the node to
* appear in cluster live nodes before returning.
*
* @param jetty a {@link JettySolrRunner} previously returned by {@link #stopJettySolrRunner(int)}
* @return the started node
Expand All @@ -524,7 +533,8 @@ public JettySolrRunner startJettySolrRunner(JettySolrRunner jetty) throws Except
}

/**
* Add a previously stopped node back to the cluster
* Add a previously stopped node back to the cluster. Waits for the node to appear in cluster live
* nodes before returning.
*
* @param jetty a {@link JettySolrRunner} previously returned by {@link #stopJettySolrRunner(int)}
* @param reusePort the port previously used by jetty
Expand All @@ -535,6 +545,7 @@ public JettySolrRunner startJettySolrRunner(JettySolrRunner jetty, boolean reuse
throws Exception {
jetty.start(reusePort);
if (!jettys.contains(jetty)) jettys.add(jetty);
waitForNode(jetty, DEFAULT_TIMEOUT);
return jetty;
}

Expand Down
Loading