Repository: tez Updated Branches: refs/heads/master c6f245f0f -> 83a3c989b
TEZ-2859. TestMergeManager.testLocalDiskMergeMultipleTasks failing (rbalamohan) Project: http://git-wip-us.apache.org/repos/asf/tez/repo Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/83a3c989 Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/83a3c989 Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/83a3c989 Branch: refs/heads/master Commit: 83a3c989b6db373b055a9a671f300daea25e203e Parents: c6f245f Author: Rajesh Balamohan <[email protected]> Authored: Tue Sep 29 08:23:42 2015 +0530 Committer: Rajesh Balamohan <[email protected]> Committed: Tue Sep 29 08:23:42 2015 +0530 ---------------------------------------------------------------------- CHANGES.txt | 1 + .../common/shuffle/orderedgrouped/TestMergeManager.java | 12 ++++++++++++ 2 files changed, 13 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tez/blob/83a3c989/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 86fcff5..f65cfda 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -7,6 +7,7 @@ Release 0.8.1: Unreleased INCOMPATIBLE CHANGES ALL CHANGES: + TEZ-2859. TestMergeManager.testLocalDiskMergeMultipleTasks failing TEZ-2858. Stop using System.currentTimeMillis in TestInputReadyTracker. TEZ-2857. Fix flakey tests in TestDAGImpl. TEZ-2836. Avoid setting framework/system counters for tasks running in threads. http://git-wip-us.apache.org/repos/asf/tez/blob/83a3c989/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 f3b8e99..214ec45 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 @@ -21,6 +21,8 @@ package org.apache.tez.runtime.library.common.shuffle.orderedgrouped; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertTrue; +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.spy; @@ -32,6 +34,8 @@ import java.util.List; import java.util.UUID; import com.google.common.collect.Sets; +import org.mockito.invocation.InvocationOnMock; +import org.mockito.stubbing.Answer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.apache.hadoop.conf.Configuration; @@ -417,6 +421,14 @@ 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();
