tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hit...@apache.org
Subject tez git commit: TEZ-2058. Flaky test: TestTezJobs::testInvalidQueueSubmission. (hitesh)
Date Wed, 18 Feb 2015 19:11:58 GMT
Repository: tez
Updated Branches:
  refs/heads/branch-0.5 45167a4cf -> 0b76d70cf


TEZ-2058. Flaky test: TestTezJobs::testInvalidQueueSubmission. (hitesh)

(cherry picked from commit 88d23256ff7e5038ceb4b68877a41d2279b1cbeb)


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

Branch: refs/heads/branch-0.5
Commit: 0b76d70cf532d0b6c1ff11c6b0e6a527e8a5da7b
Parents: 45167a4
Author: Hitesh Shah <hitesh@apache.org>
Authored: Wed Feb 18 11:10:55 2015 -0800
Committer: Hitesh Shah <hitesh@apache.org>
Committed: Wed Feb 18 11:11:48 2015 -0800

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../java/org/apache/tez/test/TestTezJobs.java   | 43 +++++++++++++++++++-
 2 files changed, 42 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/0b76d70c/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 07e2735..e17dc07 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -4,6 +4,7 @@ Apache Tez Change Log
 Release 0.5.4: Unreleased
 
 ALL CHANGES:
+  TEZ-2058. Flaky test: TestTezJobs::testInvalidQueueSubmission.
   TEZ-2037. Should log TaskAttemptFinishedEvent if taskattempt is recovered to KILLED.
   TEZ-2071. TestAMRecovery should set test names for test DAGs.
   TEZ-1928. Tez local mode hang in Pig tez local mode.

http://git-wip-us.apache.org/repos/asf/tez/blob/0b76d70c/tez-tests/src/test/java/org/apache/tez/test/TestTezJobs.java
----------------------------------------------------------------------
diff --git a/tez-tests/src/test/java/org/apache/tez/test/TestTezJobs.java b/tez-tests/src/test/java/org/apache/tez/test/TestTezJobs.java
index dd8dba9..aacddc1 100644
--- a/tez-tests/src/test/java/org/apache/tez/test/TestTezJobs.java
+++ b/tez-tests/src/test/java/org/apache/tez/test/TestTezJobs.java
@@ -57,6 +57,7 @@ import org.apache.tez.dag.api.DataSourceDescriptor;
 import org.apache.tez.dag.api.InputDescriptor;
 import org.apache.tez.dag.api.InputInitializerDescriptor;
 import org.apache.tez.dag.api.ProcessorDescriptor;
+import org.apache.tez.dag.api.SessionNotRunning;
 import org.apache.tez.dag.api.TezConfiguration;
 import org.apache.tez.dag.api.TezException;
 import org.apache.tez.dag.api.Vertex;
@@ -538,10 +539,47 @@ public class TestTezJobs {
       remoteFs.mkdirs(inputDir);
       String outputDirStr = "/tmp/owc-output";
       outputPaths[0] = outputDirStr;
+      int result = job.run(tezConf, new String[] { StringUtils.join(",", inputPaths),
+          StringUtils.join(",", outputPaths), "2" }, null);
+      Assert.assertTrue("Job should have failed", result != 0);
+    } catch (IOException e) {
+      Assert.assertTrue(e.getMessage().contains("Failed to submit application to YARN"));
+    } finally {
+      if (yarnClient != null) {
+        yarnClient.stop();
+      }
+    }
+  }
+
+  @Test(timeout = 60000)
+  public void testInvalidQueueSubmissionToSession() throws Exception {
+
+    TezConfiguration tezConf = new TezConfiguration(mrrTezCluster.getConfig());
+    YarnClient yarnClient = YarnClient.createYarnClient();
+    try {
+
+      yarnClient.init(mrrTezCluster.getConfig());
+      yarnClient.start();
+
+      SimpleSessionExample job = new SimpleSessionExample();
+      tezConf.setBoolean(TezConfiguration.TEZ_AM_SESSION_MODE, true);
+      tezConf.set(TezConfiguration.TEZ_QUEUE_NAME, "nonexistent");
+
+      String[] inputPaths = new String[1];
+      String[] outputPaths = new String[1];
+      String inputDirStr = "/tmp/owc-input";
+      inputPaths[0] = inputDirStr;
+      Path inputDir = new Path(inputDirStr);
+      remoteFs.mkdirs(inputDir);
+      String outputDirStr = "/tmp/owc-output";
+      outputPaths[0] = outputDirStr;
       job.run(tezConf, new String[] { StringUtils.join(",", inputPaths),
           StringUtils.join(",", outputPaths), "2" }, null);
-      fail("Job submission should have thrown an exception");
-    } catch(IOException e) {
+      fail("Job submission should have failed");
+    } catch (SessionNotRunning e) {
+      // Expected
+      LOG.info("Session not running", e);
+    } catch (IOException e) {
       Assert.assertTrue(e.getMessage().contains("Failed to submit application to YARN"));
     } finally {
       if (yarnClient != null) {
@@ -551,6 +589,7 @@ public class TestTezJobs {
 
   }
 
+
   @Test (timeout=60000)
   public void testVertexOrder() throws Exception {
     TezConfiguration tezConf = new TezConfiguration(mrrTezCluster.getConfig());


Mime
View raw message