Repository: tez Updated Branches: refs/heads/master 9faa54c2c -> d91eb2835
TEZ-2340. TestRecoveryParser fails (zjffdu) Project: http://git-wip-us.apache.org/repos/asf/tez/repo Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/d91eb283 Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/d91eb283 Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/d91eb283 Branch: refs/heads/master Commit: d91eb283523a9dc98a73f79c845a4a7ecc8e5e16 Parents: 9faa54c Author: Jeff Zhang <[email protected]> Authored: Thu Apr 23 08:53:18 2015 +0800 Committer: Jeff Zhang <[email protected]> Committed: Thu Apr 23 08:53:18 2015 +0800 ---------------------------------------------------------------------- CHANGES.txt | 1 + .../java/org/apache/tez/dag/app/TestRecoveryParser.java | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tez/blob/d91eb283/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 5c91872..c32830e 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -9,6 +9,7 @@ INCOMPATIBLE CHANGES TEZ-1993. Implement a pluggable InputSizeEstimator for grouping fairly ALL CHANGES: + TEZ-2340. TestRecoveryParser fails TEZ-2345. Tez UI: Enable cell level loading in all DAGs table TEZ-2330. Create reconfigureVertex() API for input based initialization TEZ-2292. Add e2e test for error reporting when vertex manager invokes http://git-wip-us.apache.org/repos/asf/tez/blob/d91eb283/tez-dag/src/test/java/org/apache/tez/dag/app/TestRecoveryParser.java ---------------------------------------------------------------------- diff --git a/tez-dag/src/test/java/org/apache/tez/dag/app/TestRecoveryParser.java b/tez-dag/src/test/java/org/apache/tez/dag/app/TestRecoveryParser.java index 16c3a38..a256244 100644 --- a/tez-dag/src/test/java/org/apache/tez/dag/app/TestRecoveryParser.java +++ b/tez-dag/src/test/java/org/apache/tez/dag/app/TestRecoveryParser.java @@ -54,6 +54,7 @@ public class TestRecoveryParser { private static String TEST_ROOT_DIR = "target" + Path.SEPARATOR + TestRecoveryParser.class.getName() + "-tmpDir"; + private ApplicationId appId; private RecoveryParser parser; private FileSystem localFS; private Configuration conf; @@ -65,7 +66,8 @@ public class TestRecoveryParser { public void setUp() throws IllegalArgumentException, IOException { this.conf = new Configuration(); this.localFS = FileSystem.getLocal(conf); - this.recoveryPath = new Path(TEST_ROOT_DIR + "/recovery"); + this.appId = ApplicationId.newInstance(System.currentTimeMillis(), 1); + this.recoveryPath = new Path(TEST_ROOT_DIR + "/" + appId + "/recovery"); this.localFS.delete(new Path(TEST_ROOT_DIR), true); mockAppMaster = mock(DAGAppMaster.class); mockAppMaster.dagNames = new HashSet<String>(); @@ -167,7 +169,7 @@ public class TestRecoveryParser { // skipAllOtherEvents due to dag finished @Test (timeout = 5000) public void testSkipAllOtherEvents_2() throws IOException { - ApplicationId appId = ApplicationId.newInstance(System.currentTimeMillis(), 1); + ApplicationAttemptId appAttemptId = ApplicationAttemptId.newInstance(appId, 1); TezDAGID dagID = TezDAGID.getInstance(appId, 1); AppContext appContext = mock(AppContext.class); when(appContext.getCurrentRecoveryDir()).thenReturn(new Path(recoveryPath+"/1")); @@ -205,7 +207,8 @@ public class TestRecoveryParser { assertEquals(true, dagData.isCompleted); // DAGSubmittedEvent, DAGInitializedEvent and DAGFinishedEvent is handled verify(mockAppMaster).createDAG(any(DAGPlan.class),any(TezDAGID.class)); - verify(dagData.recoveredDAG).restoreFromEvent(isA(DAGInitializedEvent.class)); + // DAGInitializedEvent may not been handled before DAGFinishedEvent, + // because DAGFinishedEvent's writeToRecoveryImmediately is true verify(dagData.recoveredDAG).restoreFromEvent(isA(DAGFinishedEvent.class)); // DAGStartedEvent is skipped due to it is after DAGFinishedEvent verify(dagData.recoveredDAG, never()).restoreFromEvent(isA(DAGStartedEvent.class));
