Author: jlowe
Date: Thu Oct 10 15:50:33 2013
New Revision: 1531032
URL: http://svn.apache.org/r1531032
Log:
YARN-155. TestAppManager intermittently fails with jdk7. Contributed by Thomas
Graves
Modified:
hadoop/common/branches/branch-0.23/hadoop-yarn-project/CHANGES.txt
hadoop/common/branches/branch-0.23/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestAppManager.java
Modified: hadoop/common/branches/branch-0.23/hadoop-yarn-project/CHANGES.txt
URL:
http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-yarn-project/CHANGES.txt?rev=1531032&r1=1531031&r2=1531032&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.23/hadoop-yarn-project/CHANGES.txt
(original)
+++ hadoop/common/branches/branch-0.23/hadoop-yarn-project/CHANGES.txt Thu Oct
10 15:50:33 2013
@@ -43,6 +43,9 @@ Release 0.23.10 - UNRELEASED
YARN-1243. ResourceManager: Error in handling event type NODE_UPDATE to the
scheduler - NPE at SchedulerApp.java:411 (Jason Lowe via jeagles)
+ YARN-155. TestAppManager intermittently fails with jdk7 (Thomas Graves via
+ jlowe)
+
Release 0.23.9 - 2013-07-08
INCOMPATIBLE CHANGES
Modified:
hadoop/common/branches/branch-0.23/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestAppManager.java
URL:
http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestAppManager.java?rev=1531032&r1=1531031&r2=1531032&view=diff
==============================================================================
---
hadoop/common/branches/branch-0.23/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestAppManager.java
(original)
+++
hadoop/common/branches/branch-0.23/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestAppManager.java
Thu Oct 10 15:50:33 2013
@@ -51,6 +51,7 @@ import org.apache.hadoop.yarn.server.res
import
org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler;
import org.apache.hadoop.yarn.server.security.ApplicationACLsManager;
import org.apache.hadoop.yarn.service.Service;
+import org.junit.After;
import org.junit.Test;
import com.google.common.collect.Lists;
@@ -122,7 +123,6 @@ public class TestAppManager{
@Override
public void handle(RMAppEvent event) {
- //RMApp rmApp = this.rmContext.getRMApps().get(appID);
setAppEventType(event.getType());
System.out.println("in handle routine " + getAppEventType().toString());
}
@@ -176,6 +176,13 @@ public class TestAppManager{
}
}
+ @After
+ public void teardown() {
+ // reset the type to KILL before starting each test since that is used
+ // as expected initial state in some of the tests
+ setAppEventType(RMAppEventType.KILL);
+ }
+
@Test
public void testRMAppRetireNone() throws Exception {
long now = System.currentTimeMillis();
@@ -326,7 +333,7 @@ public class TestAppManager{
rmContext.getDispatcher().register(RMAppManagerEventType.class,
testAppManagerDispatcher);
((Service)rmContext.getDispatcher()).init(conf);
((Service)rmContext.getDispatcher()).start();
- Assert.assertEquals("app event type is wrong before", RMAppEventType.KILL,
appEventType);
+ Assert.assertEquals("app event type is wrong before", RMAppEventType.KILL,
getAppEventType());
}
@Test
@@ -372,7 +379,6 @@ public class TestAppManager{
Thread.sleep(1000);
}
Assert.assertEquals("app event type sent is wrong", RMAppEventType.START,
getAppEventType());
- setAppEventType(RMAppEventType.KILL);
((Service)rmContext.getDispatcher()).stop();
}
@@ -418,7 +424,6 @@ public class TestAppManager{
Thread.sleep(1000);
}
Assert.assertEquals("app event type sent is wrong", RMAppEventType.START,
getAppEventType());
- setAppEventType(RMAppEventType.KILL);
((Service)rmContext.getDispatcher()).stop();
}