From e8cd9dc200ab7f0a2c934ca0cc02506a43f390b2 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 (cherry picked from commit 0cfd7ad21f4457513ed3416e5d77f3123bfe9da0) --- .../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 34d9f0ef13f..8a6fa304d4e 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 @@ public abstract class TaskImpl implements Task, EventHandler { // 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 07146478028..f681cf81650 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 class TestKill { 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());