tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bi...@apache.org
Subject tez git commit: TEZ-2238. TestContainerReuse flaky (bikas) (cherry picked from commit 17d238880b610563451defb9484b891c4ea617bb)
Date Fri, 27 Mar 2015 08:46:28 GMT
Repository: tez
Updated Branches:
  refs/heads/branch-0.5 0249a4318 -> a510f761f


TEZ-2238. TestContainerReuse flaky (bikas)
(cherry picked from commit 17d238880b610563451defb9484b891c4ea617bb)

Conflicts: (Manual merge)
	tez-dag/src/test/java/org/apache/tez/dag/app/rm/TestContainerReuse.java


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

Branch: refs/heads/branch-0.5
Commit: a510f761fc5f237056dbc87481ab7f972c93a108
Parents: 0249a43
Author: Bikas Saha <bikas@apache.org>
Authored: Fri Mar 27 01:35:17 2015 -0700
Committer: Bikas Saha <bikas@apache.org>
Committed: Fri Mar 27 01:45:39 2015 -0700

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../dag/app/rm/YarnTaskSchedulerService.java    |  2 +-
 .../tez/dag/app/rm/TestContainerReuse.java      | 37 +++++++++++++++++++-
 .../dag/app/rm/TestTaskSchedulerHelpers.java    |  1 -
 4 files changed, 38 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/a510f761/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index b2383a0..55b1cc4 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -4,6 +4,7 @@ Apache Tez Change Log
 Release 0.5.4: Unreleased
 
 ALL CHANGES:
+  TEZ-2238. TestContainerReuse flaky
   TEZ-2217. The min-held-containers being released prematurely
   TEZ-2214. FetcherOrderedGrouped can get stuck indefinitely when MergeManager misses memToDiskMerging
   TEZ-1923. FetcherOrderedGrouped gets into infinite loop due to memory pressure

http://git-wip-us.apache.org/repos/asf/tez/blob/a510f761/tez-dag/src/main/java/org/apache/tez/dag/app/rm/YarnTaskSchedulerService.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/main/java/org/apache/tez/dag/app/rm/YarnTaskSchedulerService.java
b/tez-dag/src/main/java/org/apache/tez/dag/app/rm/YarnTaskSchedulerService.java
index bc3c216..a6a9441 100644
--- a/tez-dag/src/main/java/org/apache/tez/dag/app/rm/YarnTaskSchedulerService.java
+++ b/tez-dag/src/main/java/org/apache/tez/dag/app/rm/YarnTaskSchedulerService.java
@@ -1831,8 +1831,8 @@ public class YarnTaskSchedulerService extends TaskSchedulerService
             try {
               // test only signaling to make TestTaskScheduler work
               if (drainedDelayedContainersForTest != null) {
-                drainedDelayedContainersForTest.set(true);
                 synchronized (drainedDelayedContainersForTest) {
+                  drainedDelayedContainersForTest.set(true);
                   drainedDelayedContainersForTest.notifyAll();
                 }
               }

http://git-wip-us.apache.org/repos/asf/tez/blob/a510f761/tez-dag/src/test/java/org/apache/tez/dag/app/rm/TestContainerReuse.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/test/java/org/apache/tez/dag/app/rm/TestContainerReuse.java b/tez-dag/src/test/java/org/apache/tez/dag/app/rm/TestContainerReuse.java
index b06c1a0..a8825ea 100644
--- a/tez-dag/src/test/java/org/apache/tez/dag/app/rm/TestContainerReuse.java
+++ b/tez-dag/src/test/java/org/apache/tez/dag/app/rm/TestContainerReuse.java
@@ -103,6 +103,7 @@ public class TestContainerReuse {
   @Test(timeout = 15000l)
   public void testDelayedReuseContainerBecomesAvailable()
       throws IOException, InterruptedException, ExecutionException {
+    LOG.info("Test testDelayedReuseContainerBecomesAvailable");
     Configuration conf = new Configuration(new YarnConfiguration());
     conf.setBoolean(
       TezConfiguration.TEZ_AM_CONTAINER_REUSE_ENABLED, true);
@@ -114,6 +115,7 @@ public class TestContainerReuse {
       TezConfiguration.TEZ_AM_CONTAINER_REUSE_LOCALITY_DELAY_ALLOCATION_MILLIS, 3000l);
     conf.setLong(TezConfiguration.TEZ_AM_CONTAINER_IDLE_RELEASE_TIMEOUT_MIN_MILLIS, 0);
     RackResolver.init(conf);
+    conf.setLong(TezConfiguration.TEZ_AM_CONTAINER_IDLE_RELEASE_TIMEOUT_MAX_MILLIS, 0);
     TaskSchedulerAppCallback mockApp = mock(TaskSchedulerAppCallback.class);
 
     CapturingEventHandler eventHandler = new CapturingEventHandler();
@@ -188,8 +190,12 @@ public class TestContainerReuse {
       createLaunchRequestEvent(taID31, ta31, resource, host1,
         defaultRack, priority);
 
+    drainNotifier.set(false);
     taskSchedulerEventHandler.handleEvent(lrTa11);
+    TestTaskSchedulerHelpers.waitForDelayedDrainNotify(drainNotifier);
+    drainNotifier.set(false);
     taskSchedulerEventHandler.handleEvent(lrTa21);
+    TestTaskSchedulerHelpers.waitForDelayedDrainNotify(drainNotifier);
 
     Container containerHost1 = createContainer(1, host1[0], resource, priority);
     Container containerHost2 = createContainer(2, host2[0], resource, priority);
@@ -245,6 +251,7 @@ public class TestContainerReuse {
   @Test(timeout = 15000l)
   public void testDelayedReuseContainerNotAvailable()
       throws IOException, InterruptedException, ExecutionException {
+    LOG.info("Test testDelayedReuseContainerNotAvailable");
     Configuration conf = new Configuration(new YarnConfiguration());
     conf.setBoolean(TezConfiguration.TEZ_AM_CONTAINER_REUSE_ENABLED, true);
     conf.setBoolean(TezConfiguration.TEZ_AM_CONTAINER_REUSE_RACK_FALLBACK_ENABLED, false);
@@ -252,6 +259,7 @@ public class TestContainerReuse {
     conf.setLong(TezConfiguration.TEZ_AM_CONTAINER_REUSE_LOCALITY_DELAY_ALLOCATION_MILLIS,
1000l);
     conf.setLong(TezConfiguration.TEZ_AM_CONTAINER_IDLE_RELEASE_TIMEOUT_MIN_MILLIS, 0);
     RackResolver.init(conf);
+    conf.setLong(TezConfiguration.TEZ_AM_CONTAINER_IDLE_RELEASE_TIMEOUT_MAX_MILLIS, 0);
     TaskSchedulerAppCallback mockApp = mock(TaskSchedulerAppCallback.class);
 
     CapturingEventHandler eventHandler = new CapturingEventHandler();
@@ -319,8 +327,12 @@ public class TestContainerReuse {
     AMSchedulerEventTALaunchRequest lrTa31 = createLaunchRequestEvent(
       taID31, ta31, resource, host1, defaultRack, priority);
 
+    drainNotifier.set(false);
     taskSchedulerEventHandler.handleEvent(lrTa11);
+    TestTaskSchedulerHelpers.waitForDelayedDrainNotify(drainNotifier);
+    drainNotifier.set(false);
     taskSchedulerEventHandler.handleEvent(lrTa21);
+    TestTaskSchedulerHelpers.waitForDelayedDrainNotify(drainNotifier);
 
     Container containerHost1 = createContainer(1, host1[0], resource, priority);
     Container containerHost2 = createContainer(2, host2[0], resource, priority);
@@ -353,12 +365,14 @@ public class TestContainerReuse {
 
   @Test(timeout = 10000l)
   public void testSimpleReuse() throws IOException, InterruptedException, ExecutionException
{
+    LOG.info("Test testSimpleReuse");
     Configuration tezConf = new Configuration(new YarnConfiguration());
     tezConf.setBoolean(TezConfiguration.TEZ_AM_CONTAINER_REUSE_ENABLED, true);
     tezConf.setBoolean(TezConfiguration.TEZ_AM_CONTAINER_REUSE_RACK_FALLBACK_ENABLED, true);
     tezConf.setLong(TezConfiguration.TEZ_AM_CONTAINER_REUSE_LOCALITY_DELAY_ALLOCATION_MILLIS,
0);
     tezConf.setLong(TezConfiguration.TEZ_AM_CONTAINER_IDLE_RELEASE_TIMEOUT_MIN_MILLIS, 0);
     RackResolver.init(tezConf);
+    tezConf.setLong(TezConfiguration.TEZ_AM_CONTAINER_IDLE_RELEASE_TIMEOUT_MAX_MILLIS, 0);
     TaskSchedulerAppCallback mockApp = mock(TaskSchedulerAppCallback.class);
 
     CapturingEventHandler eventHandler = new CapturingEventHandler();
@@ -488,11 +502,13 @@ public class TestContainerReuse {
 
   @Test(timeout = 10000l)
   public void testReuseWithTaskSpecificLaunchCmdOption() throws IOException, InterruptedException,
ExecutionException {
+    LOG.info("Test testReuseWithTaskSpecificLaunchCmdOption");
     Configuration tezConf = new Configuration(new YarnConfiguration());
     tezConf.setBoolean(TezConfiguration.TEZ_AM_CONTAINER_REUSE_ENABLED, true);
     tezConf.setBoolean(TezConfiguration.TEZ_AM_CONTAINER_REUSE_RACK_FALLBACK_ENABLED, true);
     tezConf.setLong(TezConfiguration.TEZ_AM_CONTAINER_REUSE_LOCALITY_DELAY_ALLOCATION_MILLIS,
0);
     tezConf.setLong(TezConfiguration.TEZ_AM_CONTAINER_IDLE_RELEASE_TIMEOUT_MIN_MILLIS, 0);
+    tezConf.setLong(TezConfiguration.TEZ_AM_CONTAINER_IDLE_RELEASE_TIMEOUT_MAX_MILLIS, 0);
     //Profile 3 tasks
     tezConf.set(TezConfiguration.TEZ_TASK_SPECIFIC_LAUNCH_CMD_OPTS_LIST, "v1[1,3,4]");
     tezConf.set(TezConfiguration.TEZ_TASK_SPECIFIC_LAUNCH_CMD_OPTS, "dir=/tmp/__VERTEX_NAME__/__TASK_INDEX__");
@@ -566,8 +582,12 @@ public class TestContainerReuse {
     AMSchedulerEventTALaunchRequest lrEvent2 =
         createLaunchRequestEvent(taID12, ta12, resource1, host1, racks, priority1);
 
+    drainNotifier.set(false);
     taskSchedulerEventHandler.handleEvent(lrEvent1);
+    TestTaskSchedulerHelpers.waitForDelayedDrainNotify(drainNotifier);
+    drainNotifier.set(false);
     taskSchedulerEventHandler.handleEvent(lrEvent2);
+    TestTaskSchedulerHelpers.waitForDelayedDrainNotify(drainNotifier);
 
     Container container1 = createContainer(1, "host1", resource1, priority1);
 
@@ -610,8 +630,12 @@ public class TestContainerReuse {
             priority1, localResources, tsLaunchCmdOpts);
 
     Container container2 = createContainer(2, "host2", resource1, priority1);
+    drainNotifier.set(false);
     taskSchedulerEventHandler.handleEvent(lrEvent3);
+    TestTaskSchedulerHelpers.waitForDelayedDrainNotify(drainNotifier);
+    drainNotifier.set(false);
     taskSchedulerEventHandler.handleEvent(lrEvent4);
+    TestTaskSchedulerHelpers.waitForDelayedDrainNotify(drainNotifier);
 
     // Container started
     drainNotifier.set(false);
@@ -680,6 +704,7 @@ public class TestContainerReuse {
   @Test(timeout = 30000l)
   public void testReuseNonLocalRequest()
       throws IOException, InterruptedException, ExecutionException {
+    LOG.info("Test testReuseNonLocalRequest");
     Configuration tezConf = new Configuration(new YarnConfiguration());
     tezConf.setBoolean(TezConfiguration.TEZ_AM_CONTAINER_REUSE_ENABLED, true);
     tezConf.setBoolean(TezConfiguration.TEZ_AM_CONTAINER_REUSE_RACK_FALLBACK_ENABLED, true);
@@ -756,7 +781,9 @@ public class TestContainerReuse {
       taID12, ta12, resource1, emptyHosts, racks, priority);
 
     // Send launch request for task 1 only, deterministic assignment to this task.
+    drainNotifier.set(false);
     taskSchedulerEventHandler.handleEvent(lrEvent11);
+    TestTaskSchedulerHelpers.waitForDelayedDrainNotify(drainNotifier);
 
     Container container1 = createContainer(1, "randomHost", resource1, priority);
 
@@ -807,6 +834,7 @@ public class TestContainerReuse {
   @Test(timeout = 30000l)
   public void testReuseAcrossVertices()
       throws IOException, InterruptedException, ExecutionException {
+    LOG.info("Test testReuseAcrossVertices");
     Configuration tezConf = new Configuration(new YarnConfiguration());
     tezConf.setBoolean(TezConfiguration.TEZ_AM_CONTAINER_REUSE_ENABLED, true);
     tezConf.setLong(
@@ -888,7 +916,9 @@ public class TestContainerReuse {
       taID21, ta21, resource1, host1, racks, priority2);
 
     // Send launch request for task 1 onle, deterministic assignment to this task.
+    drainNotifier.set(false);
     taskSchedulerEventHandler.handleEvent(lrEvent11);
+    TestTaskSchedulerHelpers.waitForDelayedDrainNotify(drainNotifier);
 
     Container container1 = createContainer(1, host1[0], resource1, priority1);
 
@@ -931,6 +961,7 @@ public class TestContainerReuse {
   
   @Test(timeout = 30000l)
   public void testReuseLocalResourcesChanged() throws IOException, InterruptedException,
ExecutionException {
+    LOG.info("Test testReuseLocalResourcesChanged");
     Configuration tezConf = new Configuration(new YarnConfiguration());
     tezConf.setBoolean(TezConfiguration.TEZ_AM_CONTAINER_REUSE_ENABLED, true);
     tezConf.setBoolean(TezConfiguration.TEZ_AM_CONTAINER_REUSE_RACK_FALLBACK_ENABLED, true);
@@ -1005,8 +1036,12 @@ public class TestContainerReuse {
     TaskAttempt ta112 = mock(TaskAttempt.class);
     AMSchedulerEventTALaunchRequest lrEvent12 = createLaunchRequestEvent(taID112, ta112,
resource1, host1, racks, priority1, dag1LRs);
 
+    drainNotifier.set(false);
     taskSchedulerEventHandler.handleEvent(lrEvent11);
+    TestTaskSchedulerHelpers.waitForDelayedDrainNotify(drainNotifier);
+    drainNotifier.set(false);
     taskSchedulerEventHandler.handleEvent(lrEvent12);
+    TestTaskSchedulerHelpers.waitForDelayedDrainNotify(drainNotifier);
 
     Container container1 = createContainer(1, "host1", resource1, priority1);
 
@@ -1155,4 +1190,4 @@ public class TestContainerReuse {
       return this.dagID;
     }
   }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/tez/blob/a510f761/tez-dag/src/test/java/org/apache/tez/dag/app/rm/TestTaskSchedulerHelpers.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/test/java/org/apache/tez/dag/app/rm/TestTaskSchedulerHelpers.java
b/tez-dag/src/test/java/org/apache/tez/dag/app/rm/TestTaskSchedulerHelpers.java
index b0ea644..e5b52ef 100644
--- a/tez-dag/src/test/java/org/apache/tez/dag/app/rm/TestTaskSchedulerHelpers.java
+++ b/tez-dag/src/test/java/org/apache/tez/dag/app/rm/TestTaskSchedulerHelpers.java
@@ -319,7 +319,6 @@ class TestTaskSchedulerHelpers {
         } else {
           fail("Timed out while trying to drain queue");
         }
-
       }
     }
   }


Mime
View raw message