tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bi...@apache.org
Subject git commit: TEZ-1065 addendum to fix broken test (bikas)
Date Fri, 15 Aug 2014 18:51:28 GMT
Repository: tez
Updated Branches:
  refs/heads/master dc27e010f -> 2422ca758


TEZ-1065 addendum to fix broken test (bikas)


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

Branch: refs/heads/master
Commit: 2422ca7584353f69bbc3ed2c1ce22374124d68e7
Parents: dc27e01
Author: Bikas Saha <bikas@apache.org>
Authored: Fri Aug 15 11:51:31 2014 -0700
Committer: Bikas Saha <bikas@apache.org>
Committed: Fri Aug 15 11:51:31 2014 -0700

----------------------------------------------------------------------
 .../org/apache/tez/dag/api/TestDAGPlan.java     | 22 +++++++++++---------
 1 file changed, 12 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/2422ca75/tez-api/src/test/java/org/apache/tez/dag/api/TestDAGPlan.java
----------------------------------------------------------------------
diff --git a/tez-api/src/test/java/org/apache/tez/dag/api/TestDAGPlan.java b/tez-api/src/test/java/org/apache/tez/dag/api/TestDAGPlan.java
index d468bb6..2ba9aee 100644
--- a/tez-api/src/test/java/org/apache/tez/dag/api/TestDAGPlan.java
+++ b/tez-api/src/test/java/org/apache/tez/dag/api/TestDAGPlan.java
@@ -232,17 +232,19 @@ public class TestDAGPlan {
     VertexPlan v3Proto = dagProto.getVertex(2);
     EdgePlan edgeProto = dagProto.getEdge(0);
 
-    assertEquals("processor1Bytes", new String(v1Proto.getProcessorDescriptor()
-        .getUserPayload().toByteArray()));
-    assertEquals("processor1", v1Proto.getProcessorDescriptor().getClassName());
-
-    assertEquals("processor2Bytes", new String(v2Proto.getProcessorDescriptor()
-        .getUserPayload().toByteArray()));
-    assertEquals("processor2", v2Proto.getProcessorDescriptor().getClassName());
-
-    assertEquals("processor3Bytes", new String(v3Proto.getProcessorDescriptor()
+    // either v1 or v2 will be on top based on topological order 
+    String v1ProtoPayload = new String(v1Proto.getProcessorDescriptor().getUserPayload().toByteArray());
+    String v2ProtoPayload = new String(v2Proto.getProcessorDescriptor().getUserPayload().toByteArray());
+    assertTrue(v1ProtoPayload.equals("processor1Bytes") || v1ProtoPayload.equals("processor3Bytes"));
+    assertTrue(v2ProtoPayload.equals("processor1Bytes") || v2ProtoPayload.equals("processor3Bytes"));
+    assertTrue(v1Proto.getProcessorDescriptor().getClassName().equals("processor1") ||
+        v1Proto.getProcessorDescriptor().getClassName().equals("processor3"));
+    assertTrue(v2Proto.getProcessorDescriptor().getClassName().equals("processor1") ||
+        v2Proto.getProcessorDescriptor().getClassName().equals("processor3"));
+
+    assertEquals("processor2Bytes", new String(v3Proto.getProcessorDescriptor()
         .getUserPayload().toByteArray()));
-    assertEquals("processor3", v3Proto.getProcessorDescriptor().getClassName());
+    assertEquals("processor2", v3Proto.getProcessorDescriptor().getClassName());
 
     assertEquals("inputBytes", new String(edgeProto.getEdgeDestination()
         .getUserPayload().toByteArray()));


Mime
View raw message