SOLR-6090: Remove unreachable printLayout usage in cloud tests

This commit is contained in:
Shalin Shekhar Mangar 2016-09-23 18:07:33 +05:30
parent 24ec3bd085
commit 3eb0f7c792
12 changed files with 5 additions and 82 deletions

View File

@ -178,6 +178,8 @@ Other Changes
* SOLR-6677: Reduced logging during Solr startup, moved more logs to DEBUG level (janhoy, Shawn Heisey)
* SOLR-6090: Remove unreachable printLayout usage in cloud tests. (Cao Manh Dat via shalin)
================== 6.2.1 ==================
Bug Fixes

View File

@ -87,7 +87,6 @@ public class BasicDistributedZkTest extends AbstractFullDistribZkTestBase {
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
private static final String DEFAULT_COLLECTION = "collection1";
protected static final boolean DEBUG = false;
String t1="a_t";
String i1="a_i1";
String tlong = "other_tl1";
@ -366,10 +365,6 @@ public class BasicDistributedZkTest extends AbstractFullDistribZkTestBase {
testUpdateProcessorsRunOnlyOnce("distrib-dup-test-chain-implicit");
testStopAndStartCoresInOneInstance();
// Thread.sleep(10000000000L);
if (DEBUG) {
super.printLayout();
}
}
// Insure that total docs found is the expected number.

View File

@ -45,8 +45,6 @@ import org.slf4j.LoggerFactory;
public class ClusterStateUpdateTest extends SolrTestCaseJ4 {
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
private static final boolean VERBOSE = false;
protected ZkTestServer zkServer;
protected String zkDir;
@ -239,9 +237,6 @@ public class ClusterStateUpdateTest extends SolrTestCaseJ4 {
@Override
public void tearDown() throws Exception {
if (VERBOSE) {
printLayout(zkServer.getZkHost());
}
container1.shutdown();
container2.shutdown();
container3.shutdown();

View File

@ -65,8 +65,6 @@ public class CustomCollectionTest extends AbstractFullDistribZkTestBase {
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
private static final boolean DEBUG = false;
protected String getSolrXml() {
return "solr.xml";
}
@ -99,9 +97,6 @@ public class CustomCollectionTest extends AbstractFullDistribZkTestBase {
testCustomCollectionsAPI();
testRouteFieldForHashRouter();
testCreateShardRepFactor();
if (DEBUG) {
super.printLayout();
}
}

View File

@ -50,8 +50,6 @@ public class LeaderElectionIntegrationTest extends SolrTestCaseJ4 {
private final static int NUM_SHARD_REPLICAS = 5;
private static final boolean VERBOSE = false;
private static final Pattern HOST = Pattern
.compile(".*?\\:(\\d\\d\\d\\d)_.*");
@ -173,7 +171,6 @@ public class LeaderElectionIntegrationTest extends SolrTestCaseJ4 {
shard1Ports.remove(leaderPort);
// kill the leader
if (VERBOSE) System.out.println("Killing " + leaderPort);
containerMap.get(leaderPort).shutdown();
//printLayout(zkServer.getZkAddress());
@ -231,7 +228,6 @@ public class LeaderElectionIntegrationTest extends SolrTestCaseJ4 {
// make sure we have waited long enough for the first leader to have come back
Thread.sleep(ZkTestServer.TICK_TIME * 2 + 100);
if (VERBOSE) System.out.println("kill everyone");
// kill everyone but the first leader that should have reconnected by now
for (Map.Entry<Integer,CoreContainer> entry : containerMap.entrySet()) {
if (entry.getKey() != leaderPort) {
@ -270,7 +266,6 @@ public class LeaderElectionIntegrationTest extends SolrTestCaseJ4 {
int leaderPort = 0;
if (m.matches()) {
leaderPort = Integer.parseInt(m.group(1));
if (VERBOSE) System.out.println("The leader is:" + Integer.parseInt(m.group(1)));
} else {
throw new IllegalStateException();
}
@ -279,9 +274,6 @@ public class LeaderElectionIntegrationTest extends SolrTestCaseJ4 {
@Override
public void tearDown() throws Exception {
if (VERBOSE) {
printLayout(zkServer.getZkHost());
}
if (zkClient != null) {
zkClient.close();

View File

@ -77,7 +77,6 @@ public class OverseerTest extends SolrTestCaseJ4 {
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
static final int TIMEOUT = 30000;
private static final boolean DEBUG = false;
private List<Overseer> overseers = new ArrayList<>();
private List<ZkStateReader> readers = new ArrayList<>();
@ -286,11 +285,6 @@ public class OverseerTest extends SolrTestCaseJ4 {
assertNotNull(reader.getLeaderUrl(collection, "shard3", 15000));
} finally {
if (DEBUG) {
if (zkController != null) {
zkClient.printLayoutToStdOut();
}
}
close(zkClient);
if (zkController != null) {
zkController.close();
@ -360,11 +354,6 @@ public class OverseerTest extends SolrTestCaseJ4 {
assertNotNull(reader.getLeaderUrl("collection2", "shard3", 15000));
} finally {
if (DEBUG) {
if (zkController != null) {
zkClient.printLayoutToStdOut();
}
}
close(zkClient);
if (zkController != null) {
zkController.close();
@ -499,11 +488,6 @@ public class OverseerTest extends SolrTestCaseJ4 {
}
} finally {
if (DEBUG) {
if (controllers[0] != null) {
zkClient.printLayoutToStdOut();
}
}
close(zkClient);
close(overseerClient);
close(reader);

View File

@ -68,10 +68,6 @@ public class UnloadDistributedZkTest extends BasicDistributedZkTest {
testUnloadLotsOfCores(); // long
testUnloadShardAndCollection();
if (DEBUG) {
super.printLayout();
}
}
private void checkCoreNamePresenceAndSliceCount(String collectionName, String coreName,

View File

@ -52,8 +52,6 @@ import org.slf4j.LoggerFactory;
public class ZkCLITest extends SolrTestCaseJ4 {
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
private static final boolean VERBOSE = false;
protected ZkTestServer zkServer;
protected String zkDir;
@ -363,9 +361,6 @@ public class ZkCLITest extends SolrTestCaseJ4 {
@Override
public void tearDown() throws Exception {
if (VERBOSE) {
printLayout(zkServer.getZkHost());
}
zkClient.close();
zkServer.shutdown();
super.tearDown();

View File

@ -46,8 +46,6 @@ public class ZkControllerTest extends SolrTestCaseJ4 {
static final int TIMEOUT = 10000;
private static final boolean DEBUG = false;
@BeforeClass
public static void beforeClass() throws Exception {
@ -185,9 +183,6 @@ public class ZkControllerTest extends SolrTestCaseJ4 {
+ COLLECTION_NAME, Utils.toJSON(zkProps),
CreateMode.PERSISTENT, true);
if (DEBUG) {
zkClient.printLayoutToStdOut();
}
zkClient.close();
cc = getCoreContainer();

View File

@ -33,7 +33,6 @@ import org.junit.AfterClass;
import org.junit.BeforeClass;
public class ZkSolrClientTest extends AbstractSolrTestCase {
private static final boolean DEBUG = false;
@BeforeClass
public static void beforeClass() throws Exception {
@ -151,10 +150,6 @@ public class ZkSolrClientTest extends AbstractSolrTestCase {
zkClient.makePath("collections/collection3", true);
}
if (DEBUG) {
zkClient.printLayoutToStdOut();
}
assertNotNull(zkClient.exists("/collections/collection3", null, true));
assertNotNull(zkClient.exists("/collections/collection1", null, true));
@ -181,10 +176,6 @@ public class ZkSolrClientTest extends AbstractSolrTestCase {
Thread.sleep(1000 * i);
}
if (DEBUG) {
zkClient.printLayoutToStdOut();
}
assertNotNull("Node does not exist, but it should", zkClient.exists("/collections/collection4", null, true));
} finally {
@ -278,9 +269,6 @@ public class ZkSolrClientTest extends AbstractSolrTestCase {
@Override
public void process(WatchedEvent event) {
if (DEBUG) {
System.out.println("children changed");
}
cnt.incrementAndGet();
// remake watch
try {
@ -301,10 +289,6 @@ public class ZkSolrClientTest extends AbstractSolrTestCase {
zkClient.makePath("/collections/collection97/shards", true);
if (DEBUG) {
zkClient.printLayoutToStdOut();
}
// pause for the watches to fire
Thread.sleep(700);

View File

@ -43,7 +43,6 @@ public abstract class AbstractDistribZkTestBase extends BaseDistributedSearchTes
private static final String ZK_HOST = "zkHost";
private static final String ZOOKEEPER_FORCE_SYNC = "zookeeper.forceSync";
protected static final String DEFAULT_COLLECTION = "collection1";
private static final boolean DEBUG = false;
protected ZkTestServer zkServer;
private AtomicInteger homeCount = new AtomicInteger();
@ -269,9 +268,6 @@ public abstract class AbstractDistribZkTestBase extends BaseDistributedSearchTes
@Override
public void distribTearDown() throws Exception {
if (DEBUG) {
printLayout();
}
System.clearProperty(ZK_HOST);
System.clearProperty("collection");
System.clearProperty(ENABLE_UPDATE_LOG);

View File

@ -39,8 +39,6 @@ public abstract class AbstractZkTestCase extends SolrTestCaseJ4 {
public static final int TIMEOUT = 45000;
private static final boolean DEBUG = false;
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
@ -137,10 +135,6 @@ public abstract class AbstractZkTestCase extends SolrTestCaseJ4 {
@Override
public void tearDown() throws Exception {
if (DEBUG) {
printLayout(zkServer.getZkHost());
}
super.tearDown();
}