sguggilam commented on a change in pull request #1828:
URL: https://github.com/apache/hbase/pull/1828#discussion_r434073102
##########
File path:
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerReportForDuty.java
##########
@@ -223,6 +226,41 @@ public void testReportForDutyWithMasterChange() throws
Exception {
}
+ /**
+ * Tests region sever reportForDuty with manual environment edge
+ */
+ @Test(timeout = 60000)
+ public void testReportForDutyWithEnvironmentEdge() throws Exception {
+ // Start a master and wait for it to become the active/primary master.
+ // Use a random unique port
+ cluster.getConfiguration().setInt(HConstants.MASTER_PORT,
HBaseTestingUtility.randomFreePort());
+ // Set the dispatch and retry delay to 0 since we want the rpc request to
be sent immediately
+
cluster.getConfiguration().setInt("hbase.procedure.remote.dispatcher.delay.msec",
0);
+ cluster.getConfiguration().setInt("hbase.regionserver.rpc.retry.interval",
0);
+
+ // master has a rs. defaultMinToStart = 2
+ boolean tablesOnMaster =
LoadBalancer.isTablesOnMaster(testUtil.getConfiguration());
+
cluster.getConfiguration().setInt(ServerManager.WAIT_ON_REGIONSERVERS_MINTOSTART,
+ tablesOnMaster ? 2 : 1);
+
cluster.getConfiguration().setInt(ServerManager.WAIT_ON_REGIONSERVERS_MAXTOSTART,
+ tablesOnMaster ? 2 : 1);
+
+ EnvironmentEdge previousEdge = EnvironmentEdgeManager.getDelegate();
+ // Inject manual environment edge for clock skew computation between RS
and master
+ ManualEnvironmentEdge edge = new ManualEnvironmentEdge();
+ EnvironmentEdgeManager.injectEdge(edge);
+ master = cluster.addMaster();
+ rs = cluster.addRegionServer();
+ LOG.debug("Starting master: " + master.getMaster().getServerName());
+ master.start();
+ rs.start();
+
+ waitForClusterOnline(master);
+
+ // Reset the manual environment edge
+ EnvironmentEdgeManager.injectEdge(previousEdge);
Review comment:
Yes thats right but after a closer look , I see that we are destroying
the cluster after each test case anyways. Have reverted this change
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]