tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ss...@apache.org
Subject [01/23] git commit: TEZ-1010. TestAMNodeMap.testSelfBlacklist fails intermittently (bikas)
Date Fri, 20 Jun 2014 22:35:39 GMT
Repository: incubator-tez
Updated Branches:
  refs/heads/branch-0.4.1-incubating ee2f6aa6b -> 43480dac9


TEZ-1010. TestAMNodeMap.testSelfBlacklist fails intermittently (bikas)


Project: http://git-wip-us.apache.org/repos/asf/incubator-tez/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tez/commit/8974d523
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tez/tree/8974d523
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tez/diff/8974d523

Branch: refs/heads/branch-0.4.1-incubating
Commit: 8974d523af653e56577b4bff8ddd8948fdd7df95
Parents: 608c08a
Author: Bikas Saha <bikas@apache.org>
Authored: Tue Apr 1 20:10:38 2014 -0700
Committer: Siddharth Seth <sseth@apache.org>
Committed: Fri Jun 20 15:34:44 2014 -0700

----------------------------------------------------------------------
 .../tez/dag/app/rm/node/TestAMNodeMap.java      | 24 +++++++++++++-------
 1 file changed, 16 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/8974d523/tez-dag/src/test/java/org/apache/tez/dag/app/rm/node/TestAMNodeMap.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/test/java/org/apache/tez/dag/app/rm/node/TestAMNodeMap.java b/tez-dag/src/test/java/org/apache/tez/dag/app/rm/node/TestAMNodeMap.java
index 84b3dad..8744b92 100644
--- a/tez-dag/src/test/java/org/apache/tez/dag/app/rm/node/TestAMNodeMap.java
+++ b/tez-dag/src/test/java/org/apache/tez/dag/app/rm/node/TestAMNodeMap.java
@@ -44,6 +44,7 @@ import org.apache.tez.dag.app.rm.container.AMContainerEventType;
 import org.apache.tez.dag.app.rm.container.AMContainerMap;
 import org.apache.tez.dag.records.TezTaskAttemptID;
 import org.junit.After;
+import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -235,18 +236,25 @@ public class TestAMNodeMap {
     assertEquals(8, handler.events.size());
 
     int index = 0;
+    int numBlacklistingDisabledEvents = 0;
+    int numNodeBlacklistedEvents = 0;
+    int numNodeWasBlacklistedEvents = 0;
     for (Event event : handler.events) {
       LOG.info("Logging event: index:" + index++
           + " type: " + event.getType());
+      if (event.getType() == AMNodeEventType.N_IGNORE_BLACKLISTING_DISABLED) {
+        numBlacklistingDisabledEvents++;
+      } else if (event.getType() == AMSchedulerEventType.S_NODE_BLACKLISTED) {
+        numNodeBlacklistedEvents++;
+      } else if (event.getType() == AMNodeEventType.N_NODE_WAS_BLACKLISTED) {
+        numNodeWasBlacklistedEvents++;
+      } else {
+        Assert.assertTrue("Unexpected event: " + event.getType(), false);        
+      }
     }
-    assertEquals(AMNodeEventType.N_IGNORE_BLACKLISTING_DISABLED, handler.events.get(0).getType());
-    assertEquals(AMNodeEventType.N_IGNORE_BLACKLISTING_DISABLED, handler.events.get(1).getType());
-    assertEquals(AMNodeEventType.N_IGNORE_BLACKLISTING_DISABLED, handler.events.get(2).getType());
-    assertEquals(AMNodeEventType.N_IGNORE_BLACKLISTING_DISABLED, handler.events.get(3).getType());
-    assertEquals(AMSchedulerEventType.S_NODE_BLACKLISTED, handler.events.get(4).getType());
-    assertEquals(AMNodeEventType.N_NODE_WAS_BLACKLISTED, handler.events.get(5).getType());
-    assertEquals(AMSchedulerEventType.S_NODE_BLACKLISTED, handler.events.get(6).getType());
-    assertEquals(AMNodeEventType.N_NODE_WAS_BLACKLISTED, handler.events.get(7).getType());
+    assertEquals(4, numBlacklistingDisabledEvents);
+    assertEquals(2, numNodeBlacklistedEvents);
+    assertEquals(2, numNodeWasBlacklistedEvents);
     
     amNodeMap.stop();
   }


Mime
View raw message