geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstew...@apache.org
Subject geode git commit: GEODE-2859: Fix ShowDeadlockDUnitTest
Date Mon, 21 Aug 2017 22:39:56 GMT
Repository: geode
Updated Branches:
  refs/heads/develop 68e8b7e7f -> d11e1b9ee


GEODE-2859: Fix ShowDeadlockDUnitTest


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

Branch: refs/heads/develop
Commit: d11e1b9ee9a209e130263dcf40c898c1be9e855a
Parents: 68e8b7e
Author: Jared Stewart <jstewart@pivotal.io>
Authored: Fri Aug 18 14:36:40 2017 -0700
Committer: Jared Stewart <jstewart@pivotal.io>
Committed: Mon Aug 21 15:38:03 2017 -0700

----------------------------------------------------------------------
 .../cli/commands/ShowDeadlockDUnitTest.java     | 39 +++++++++++---------
 1 file changed, 22 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/d11e1b9e/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ShowDeadlockDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ShowDeadlockDUnitTest.java
b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ShowDeadlockDUnitTest.java
index 8b5c80e..cd68350 100755
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ShowDeadlockDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ShowDeadlockDUnitTest.java
@@ -18,6 +18,25 @@ import static org.apache.geode.test.dunit.Assert.assertEquals;
 import static org.apache.geode.test.dunit.Assert.assertTrue;
 import static org.apache.geode.test.dunit.Invoke.invokeInEveryVM;
 
+import java.io.File;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
+
+import org.apache.commons.io.FileUtils;
+import org.awaitility.Awaitility;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import org.apache.geode.cache.execute.Function;
 import org.apache.geode.cache.execute.FunctionContext;
 import org.apache.geode.cache.execute.FunctionService;
@@ -36,23 +55,6 @@ import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase;
 import org.apache.geode.test.junit.categories.DistributedTest;
 import org.apache.geode.test.junit.rules.serializable.SerializableTemporaryFolder;
-import org.awaitility.Awaitility;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.locks.Lock;
-import java.util.concurrent.locks.ReentrantLock;
 
 /**
  * This DUnit tests uses same code as GemFireDeadlockDetectorDUnitTest and uses the command
@@ -106,6 +108,7 @@ public class ShowDeadlockDUnitTest extends JUnit4CacheTestCase {
     assertEquals(null, detect.find().findCycle());
 
     File outputFile = new File(temporaryFolder.getRoot(), "dependency.txt");
+
     String showDeadlockCommand = new CommandStringBuilder(CliStrings.SHOW_DEADLOCK)
         .addOption(CliStrings.SHOW_DEADLOCK__DEPENDENCIES__FILE, outputFile.getName()).toString();
 
@@ -130,12 +133,14 @@ public class ShowDeadlockDUnitTest extends JUnit4CacheTestCase {
     lockTheLocks(vm1, member0);
 
     File outputFile = new File(temporaryFolder.getRoot(), "dependency.txt");
+
     String showDeadlockCommand = new CommandStringBuilder(CliStrings.SHOW_DEADLOCK)
         .addOption(CliStrings.SHOW_DEADLOCK__DEPENDENCIES__FILE, outputFile.getName()).toString();
     CommandStatement showDeadlocksCommand =
         new CommandProcessor().createCommandStatement(showDeadlockCommand, Collections.emptyMap());
 
     Awaitility.await().atMost(1, TimeUnit.MINUTES).until(() -> {
+      FileUtils.deleteQuietly(outputFile);
       Result result = showDeadlocksCommand.process();
       try {
         result.saveIncomingFiles(temporaryFolder.getRoot().getAbsolutePath());


Mime
View raw message