diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/ApplicationMasterServiceTestBase.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/ApplicationMasterServiceTestBase.java index c775bd7c38..868b4e0573 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/ApplicationMasterServiceTestBase.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/ApplicationMasterServiceTestBase.java @@ -464,6 +464,10 @@ public void testUpdateTrackingUrl() throws Exception { allocateRequest.setTrackingUrl(newTrackingUrl); am1.allocate(allocateRequest); + + // wait until RMAppAttemptEventType.STATUS_UPDATE is handled + rm.drainEvents(); + Assert.assertEquals(newTrackingUrl, rm.getRMContext().getRMApps().get( app1.getApplicationId()).getOriginalTrackingUrl());