Skip to content

Commit fe6c1bd

Browse files
committed
YARN-2871. TestRMRestart#testRMRestartGetApplicationList sometime fails
in trunk. Contributed by zhihai xu
1 parent aa07dea commit fe6c1bd

File tree

2 files changed

+8
-3
lines changed
  • hadoop-yarn-project
    • hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager

2 files changed

+8
-3
lines changed

hadoop-yarn-project/CHANGES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,9 @@ Release 2.8.0 - UNRELEASED
559559
YARN-3745. SerializedException should also try to instantiate internal
560560
exception with the default constructor. (Lavkesh Lahngir via devaraj)
561561

562+
YARN-2871. TestRMRestart#testRMRestartGetApplicationList sometime fails in trunk.
563+
(zhihai xu via xgong)
564+
562565
Release 2.7.1 - UNRELEASED
563566

564567
INCOMPATIBLE CHANGES

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMRestart.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import static org.mockito.Matchers.isA;
2222
import static org.mockito.Mockito.mock;
2323
import static org.mockito.Mockito.spy;
24+
import static org.mockito.Mockito.timeout;
2425
import static org.mockito.Mockito.times;
2526
import static org.mockito.Mockito.verify;
2627
import static org.mockito.Mockito.when;
@@ -976,9 +977,10 @@ protected RMAppManager createRMAppManager() {
976977
List<ApplicationReport> appList2 = response2.getApplicationList();
977978
Assert.assertTrue(3 == appList2.size());
978979

979-
// check application summary is logged for the completed apps after RM restart.
980-
verify(rm2.getRMAppManager(), times(3)).logApplicationSummary(
981-
isA(ApplicationId.class));
980+
// check application summary is logged for the completed apps with timeout
981+
// to make sure APP_COMPLETED events are processed, after RM restart.
982+
verify(rm2.getRMAppManager(), timeout(1000).times(3)).
983+
logApplicationSummary(isA(ApplicationId.class));
982984
}
983985

984986
private MockAM launchAM(RMApp app, MockRM rm, MockNM nm)

0 commit comments

Comments
 (0)