tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From haris...@apache.org
Subject tez git commit: TEZ-3616. TestMergeManager#testLocalDiskMergeMultipleTasks fails intermittently (Fei Hui via harishjp)
Date Wed, 19 Apr 2017 15:50:24 GMT
Repository: tez
Updated Branches:
  refs/heads/master f355a050c -> fb0e45bf7


TEZ-3616. TestMergeManager#testLocalDiskMergeMultipleTasks fails intermittently (Fei Hui via
harishjp)


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

Branch: refs/heads/master
Commit: fb0e45bf7e1d999aba5f60db2b9898ed65537fe5
Parents: f355a05
Author: Harish JP <harishjp@gmail.com>
Authored: Wed Apr 19 21:14:01 2017 +0530
Committer: Harish JP <harishjp@gmail.com>
Committed: Wed Apr 19 21:16:27 2017 +0530

----------------------------------------------------------------------
 .../orderedgrouped/TestMergeManager.java        | 26 ++++++++++++--------
 1 file changed, 16 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/fb0e45bf/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/shuffle/orderedgrouped/TestMergeManager.java
----------------------------------------------------------------------
diff --git a/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/shuffle/orderedgrouped/TestMergeManager.java
b/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/shuffle/orderedgrouped/TestMergeManager.java
index a812728..5737578 100644
--- a/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/shuffle/orderedgrouped/TestMergeManager.java
+++ b/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/shuffle/orderedgrouped/TestMergeManager.java
@@ -770,7 +770,7 @@ public class TestMergeManager {
   }
 
 
-  void testLocalDiskMergeMultipleTasks(boolean interruptInMiddle)
+  void testLocalDiskMergeMultipleTasks(final boolean interruptInMiddle)
       throws IOException, InterruptedException {
     Configuration conf = new TezConfiguration(defaultConf);
     conf.setBoolean(TezRuntimeConfiguration.TEZ_RUNTIME_COMPRESS, false);
@@ -795,7 +795,21 @@ public class TestMergeManager {
 
     MergeManager t0mergeManagerReal =
         new MergeManager(conf, localFs, localDirAllocator, t0inputContext, null, null, null,
null,
-            t0exceptionReporter, 2000000, null, false, -1);
+            t0exceptionReporter, 2000000, null, false, -1) {
+          // override for interruptInMiddle testing
+          @Override
+          public synchronized void closeOnDiskFile(FileChunk file) {
+            if (interruptInMiddle) {
+              try {
+                Thread.sleep(2000);
+              } catch (InterruptedException e) {
+                Thread.currentThread().interrupt();
+                return;
+              }
+            }
+            super.closeOnDiskFile(file);
+          }
+        };
     MergeManager t0mergeManager = spy(t0mergeManagerReal);
     t0mergeManager.configureAndStart();
 
@@ -859,14 +873,6 @@ public class TestMergeManager {
       Assert.assertEquals(1, t0mergeManager.onDiskMapOutputs.size());
     } else {
 
-      doAnswer(new Answer() {
-        @Override public Object answer(InvocationOnMock invocationOnMock) throws Throwable
{
-          //Simulate artificial delay so that interrupting thread can get a chance
-          Thread.sleep(2000);
-          return invocationOnMock.callRealMethod();
-        }
-      }).when(t0mergeManager).closeOnDiskFile(any(FileChunk.class));
-
       //Start Interrupting thread
       Thread interruptingThread = new Thread(new InterruptingThread(t0mergeManager.onDiskMerger));
       interruptingThread.start();


Mime
View raw message