|
@@ -27,6 +27,7 @@ import java.util.Iterator;
|
|
|
import java.util.List;
|
|
|
|
|
|
import org.apache.hadoop.conf.Configuration;
|
|
|
+import org.apache.hadoop.fs.CommonConfigurationKeys;
|
|
|
import org.apache.hadoop.net.NetworkTopology;
|
|
|
import org.apache.hadoop.net.ServerSocketUtil;
|
|
|
import org.apache.hadoop.security.SecurityUtil;
|
|
@@ -70,18 +71,22 @@ import org.apache.hadoop.yarn.server.resourcemanager.scheduler.event.SchedulerEv
|
|
|
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fifo.FifoScheduler;
|
|
|
import org.apache.hadoop.yarn.server.resourcemanager.security.AMRMTokenSecretManager;
|
|
|
import org.apache.hadoop.yarn.util.Records;
|
|
|
+import org.junit.AfterClass;
|
|
|
import org.junit.Assert;
|
|
|
import org.junit.BeforeClass;
|
|
|
import org.junit.Test;
|
|
|
|
|
|
public class TestAMRMClientOnRMRestart {
|
|
|
- static Configuration conf = null;
|
|
|
+ static Configuration conf = new Configuration();
|
|
|
static final int rolling_interval_sec = 13;
|
|
|
static final long am_expire_ms = 4000;
|
|
|
|
|
|
@BeforeClass
|
|
|
public static void setup() throws Exception {
|
|
|
- conf = new Configuration();
|
|
|
+ conf.setBoolean(
|
|
|
+ CommonConfigurationKeys.HADOOP_SECURITY_TOKEN_SERVICE_USE_IP, false);
|
|
|
+ SecurityUtil.setConfiguration(conf);
|
|
|
+
|
|
|
conf.set(YarnConfiguration.RECOVERY_ENABLED, "true");
|
|
|
conf.set(YarnConfiguration.RM_STORE, MemoryRMStateStore.class.getName());
|
|
|
conf.setInt(YarnConfiguration.RM_AM_MAX_ATTEMPTS,
|
|
@@ -90,6 +95,13 @@ public class TestAMRMClientOnRMRestart {
|
|
|
conf.setLong(YarnConfiguration.RM_WORK_PRESERVING_RECOVERY_SCHEDULING_WAIT_MS, 0);
|
|
|
}
|
|
|
|
|
|
+ @AfterClass
|
|
|
+ public static void tearDown() {
|
|
|
+ conf.setBoolean(
|
|
|
+ CommonConfigurationKeys.HADOOP_SECURITY_TOKEN_SERVICE_USE_IP, true);
|
|
|
+ SecurityUtil.setConfiguration(conf);
|
|
|
+ }
|
|
|
+
|
|
|
// Test does major 6 steps verification.
|
|
|
// Step-1 : AMRMClient send allocate request for 3 container requests
|
|
|
// Step-2 : 3 containers are allocated by RM.
|