From 0cfd7ad21f4457513ed3416e5d77f3123bfe9da0 Mon Sep 17 00:00:00 2001 From: Jason Lowe Date: Fri, 2 Dec 2016 17:22:11 +0000 Subject: [PATCH] MAPREDUCE-6815. Fix flaky TestKill.testKillTask(). Contributed by Haibo Chen --- .../org/apache/hadoop/mapreduce/v2/app/job/impl/TaskImpl.java | 1 + .../test/java/org/apache/hadoop/mapreduce/v2/app/TestKill.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/job/impl/TaskImpl.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/job/impl/TaskImpl.java index 34d9f0ef13..8a6fa304d4 100755 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/job/impl/TaskImpl.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/job/impl/TaskImpl.java @@ -259,6 +259,7 @@ TaskEventType.T_ATTEMPT_KILLED, new RetroactiveKilledTransition()) // d. TA processes TA_KILL event and sends T_ATTEMPT_KILLED to the task. .addTransition(TaskStateInternal.KILLED, TaskStateInternal.KILLED, EnumSet.of(TaskEventType.T_KILL, + TaskEventType.T_SCHEDULE, TaskEventType.T_ATTEMPT_KILLED, TaskEventType.T_ADD_SPEC_ATTEMPT)) diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/TestKill.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/TestKill.java index 0714647802..f681cf8165 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/TestKill.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/TestKill.java @@ -105,7 +105,7 @@ public void testKillTask() throws Exception { Job job = app.submit(new Configuration()); //wait and vailidate for Job to become RUNNING - app.waitForState(job, JobState.RUNNING); + app.waitForInternalState((JobImpl) job, JobStateInternal.RUNNING); Map tasks = job.getTasks(); Assert.assertEquals("No of tasks is not correct", 2, tasks.size());