From 69c21d2db099b3a4bb612fe2876fb448471829b3 Mon Sep 17 00:00:00 2001 From: Akira Ajisaka Date: Thu, 23 Jun 2016 13:25:25 +0900 Subject: [PATCH] MAPREDUCE-6641. TestTaskAttempt fails in trunk. Contributed by Haibo Chen. --- .../hadoop/mapreduce/v2/app/job/impl/TestTaskAttempt.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/job/impl/TestTaskAttempt.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/job/impl/TestTaskAttempt.java index 1af60d85bdf..61b780ef315 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/job/impl/TestTaskAttempt.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/job/impl/TestTaskAttempt.java @@ -18,6 +18,7 @@ package org.apache.hadoop.mapreduce.v2.app.job.impl; +import static org.apache.hadoop.test.GenericTestUtils.waitFor; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -391,8 +392,8 @@ public class TestTaskAttempt{ Map attempts = task.getAttempts(); TaskAttempt attempt = attempts.values().iterator().next(); app.waitForState(attempt, TaskAttemptState.KILLED); - Assert.assertTrue("No Ta Started JH Event", app.getTaStartJHEvent()); - Assert.assertTrue("No Ta Killed JH Event", app.getTaKilledJHEvent()); + waitFor(app::getTaStartJHEvent, 100, 800); + waitFor(app::getTaKilledJHEvent, 100, 800); } static class FailingAttemptsMRApp extends MRApp {