MAPREDUCE-6508. TestNetworkedJob fails consistently due to delegation token changes on RM. Contributed by Akira AJISAKA
(cherry picked from commit eb6379ca25
)
This commit is contained in:
parent
6db7bfbcfd
commit
801ce47e28
|
@ -336,6 +336,9 @@ Release 2.8.0 - UNRELEASED
|
||||||
|
|
||||||
MAPREDUCE-6495. Docs for archive-logs tool (rkanter)
|
MAPREDUCE-6495. Docs for archive-logs tool (rkanter)
|
||||||
|
|
||||||
|
MAPREDUCE-6508. TestNetworkedJob fails consistently due to delegation
|
||||||
|
token changes on RM. (Akira AJISAKA via junping_du)
|
||||||
|
|
||||||
Release 2.7.2 - UNRELEASED
|
Release 2.7.2 - UNRELEASED
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
|
|
@ -36,8 +36,6 @@ import org.apache.hadoop.conf.Configuration;
|
||||||
import org.apache.hadoop.fs.FSDataOutputStream;
|
import org.apache.hadoop.fs.FSDataOutputStream;
|
||||||
import org.apache.hadoop.fs.FileSystem;
|
import org.apache.hadoop.fs.FileSystem;
|
||||||
import org.apache.hadoop.fs.Path;
|
import org.apache.hadoop.fs.Path;
|
||||||
import org.apache.hadoop.mapreduce.security.token.delegation.DelegationTokenIdentifier;
|
|
||||||
import org.apache.hadoop.io.Text;
|
|
||||||
import org.apache.hadoop.mapred.ClusterStatus.BlackListInfo;
|
import org.apache.hadoop.mapred.ClusterStatus.BlackListInfo;
|
||||||
import org.apache.hadoop.mapred.JobClient.NetworkedJob;
|
import org.apache.hadoop.mapred.JobClient.NetworkedJob;
|
||||||
import org.apache.hadoop.mapred.JobClient.TaskStatusFilter;
|
import org.apache.hadoop.mapred.JobClient.TaskStatusFilter;
|
||||||
|
@ -49,8 +47,6 @@ import org.apache.hadoop.yarn.conf.YarnConfiguration;
|
||||||
import org.apache.hadoop.yarn.exceptions.YarnRuntimeException;
|
import org.apache.hadoop.yarn.exceptions.YarnRuntimeException;
|
||||||
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler;
|
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.apache.hadoop.security.UserGroupInformation;
|
|
||||||
import org.apache.hadoop.security.token.Token;
|
|
||||||
|
|
||||||
public class TestNetworkedJob {
|
public class TestNetworkedJob {
|
||||||
private static String TEST_ROOT_DIR = new File(System.getProperty(
|
private static String TEST_ROOT_DIR = new File(System.getProperty(
|
||||||
|
@ -221,11 +217,6 @@ public class TestNetworkedJob {
|
||||||
status2.getBlackListedTrackersInfo());
|
status2.getBlackListedTrackersInfo());
|
||||||
assertEquals(status.getMapTasks(), status2.getMapTasks());
|
assertEquals(status.getMapTasks(), status2.getMapTasks());
|
||||||
|
|
||||||
try {
|
|
||||||
} catch (RuntimeException e) {
|
|
||||||
assertTrue(e.getMessage().endsWith("not found on CLASSPATH"));
|
|
||||||
}
|
|
||||||
|
|
||||||
// test taskStatusfilter
|
// test taskStatusfilter
|
||||||
JobClient.setTaskOutputFilter(job, TaskStatusFilter.ALL);
|
JobClient.setTaskOutputFilter(job, TaskStatusFilter.ALL);
|
||||||
assertEquals(JobClient.getTaskOutputFilter(job), TaskStatusFilter.ALL);
|
assertEquals(JobClient.getTaskOutputFilter(job), TaskStatusFilter.ALL);
|
||||||
|
@ -256,15 +247,8 @@ public class TestNetworkedJob {
|
||||||
assertEquals(aai.length, 2);
|
assertEquals(aai.length, 2);
|
||||||
assertEquals(aai[0].getQueueName(), "root");
|
assertEquals(aai[0].getQueueName(), "root");
|
||||||
assertEquals(aai[1].getQueueName(), "default");
|
assertEquals(aai[1].getQueueName(), "default");
|
||||||
// test token
|
|
||||||
Token<DelegationTokenIdentifier> token = client
|
|
||||||
.getDelegationToken(new Text(UserGroupInformation.getCurrentUser()
|
|
||||||
.getShortUserName()));
|
|
||||||
assertEquals(token.getKind().toString(), "RM_DELEGATION_TOKEN");
|
|
||||||
|
|
||||||
// test JobClient
|
// test JobClient
|
||||||
|
|
||||||
|
|
||||||
// The following asserts read JobStatus twice and ensure the returned
|
// The following asserts read JobStatus twice and ensure the returned
|
||||||
// JobStatus objects correspond to the same Job.
|
// JobStatus objects correspond to the same Job.
|
||||||
assertEquals("Expected matching JobIDs", jobId, client.getJob(jobId)
|
assertEquals("Expected matching JobIDs", jobId, client.getJob(jobId)
|
||||||
|
|
Loading…
Reference in New Issue