helix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zzh...@apache.org
Subject git commit: minor change to helix-agent test
Date Thu, 18 Apr 2013 18:42:21 GMT
Updated Branches:
  refs/heads/master 1455e483c -> 7e61ccf92


minor change to helix-agent test


Project: http://git-wip-us.apache.org/repos/asf/incubator-helix/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-helix/commit/7e61ccf9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-helix/tree/7e61ccf9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-helix/diff/7e61ccf9

Branch: refs/heads/master
Commit: 7e61ccf92418fc2fba8334fb8747d02c4531e790
Parents: 1455e48
Author: zzhang <zzhang5@uci.edu>
Authored: Thu Apr 18 11:42:14 2013 -0700
Committer: zzhang <zzhang5@uci.edu>
Committed: Thu Apr 18 11:42:14 2013 -0700

----------------------------------------------------------------------
 .../org/apache/helix/agent/TestHelixAgent.java     |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/7e61ccf9/helix-agent/src/test/java/org/apache/helix/agent/TestHelixAgent.java
----------------------------------------------------------------------
diff --git a/helix-agent/src/test/java/org/apache/helix/agent/TestHelixAgent.java b/helix-agent/src/test/java/org/apache/helix/agent/TestHelixAgent.java
index 311a07c..6f5ad6c 100644
--- a/helix-agent/src/test/java/org/apache/helix/agent/TestHelixAgent.java
+++ b/helix-agent/src/test/java/org/apache/helix/agent/TestHelixAgent.java
@@ -81,6 +81,15 @@ public class TestHelixAgent extends ZkUnitTestBase {
     
     // System.out.println("workingDir: " + workingDir);
     
+    // the pid file path for the first partition
+    // delete it if exists
+    String pidFileFirstPartition = ScriptTestHelper.getPrefix() + ScriptTestHelper.INTEGRATION_LOG_DIR
+ "/default/foo_TestDB0_0_pid.txt";
+    File file = new File(pidFileFirstPartition);
+    if (file.exists()) {
+      file.delete();
+    }
+    
+    
     CommandConfig.Builder builder = new CommandConfig.Builder();
     CommandConfig cmdConfig = builder.setTransition("SLAVE", "MASTER")
                                      .setCommand("dds_driver.py -c foo_test -o start")
@@ -148,8 +157,7 @@ public class TestHelixAgent extends ZkUnitTestBase {
     Assert.assertTrue(result);
 
     // read the pid file should get current process id
-    String pidFilePath = ScriptTestHelper.getPrefix() + ScriptTestHelper.INTEGRATION_LOG_DIR
+ "/default/foo_TestDB0_0_pid.txt";
-    String readPid = SystemUtil.getPidFromFile(new File(pidFilePath));
+    String readPid = SystemUtil.getPidFromFile(new File(pidFileFirstPartition));
     Assert.assertNotNull(readPid, "readPid is the pid for foo_test.py. should NOT be null");
     
     // String name = ManagementFactory.getRuntimeMXBean().getName();


Mime
View raw message