You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by jc...@apache.org on 2022/06/01 21:03:27 UTC

[geode] branch develop updated: GEODE-10305: Change locator and server dirs (#7730)

This is an automated email from the ASF dual-hosted git repository.

jchen21 pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new bfa8dde945 GEODE-10305: Change locator and server dirs (#7730)
bfa8dde945 is described below

commit bfa8dde945eb550df9b88de4f19f2f385743cd7c
Author: Jianxia Chen <11...@users.noreply.github.com>
AuthorDate: Wed Jun 1 14:03:21 2022 -0700

    GEODE-10305: Change locator and server dirs (#7730)
    
    Use non-temporary directories to keep the logs in case of test failure
---
 .../TomcatSessionBackwardsCompatibilityTestBase.java | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/geode-assembly/src/upgradeTest/java/org/apache/geode/session/tests/TomcatSessionBackwardsCompatibilityTestBase.java b/geode-assembly/src/upgradeTest/java/org/apache/geode/session/tests/TomcatSessionBackwardsCompatibilityTestBase.java
index b712f28c42..ff5b21e9ef 100644
--- a/geode-assembly/src/upgradeTest/java/org/apache/geode/session/tests/TomcatSessionBackwardsCompatibilityTestBase.java
+++ b/geode-assembly/src/upgradeTest/java/org/apache/geode/session/tests/TomcatSessionBackwardsCompatibilityTestBase.java
@@ -105,8 +105,14 @@ public abstract class TomcatSessionBackwardsCompatibilityTestBase {
     oldModules = new File(installLocation + "/tools/Modules/");
   }
 
-  protected void startServer(String name, String classPath, int locatorPort) throws Exception {
-    serverDir = tempFolder.newFolder("server").getPath();
+  protected void startServer(String name, String classPath, int locatorPort) throws IOException {
+    File serverFile = new File("server_dir_" + this.getClass().getSimpleName() + "_"
+        + testName.getMethodName().replace("[", "").replace("]", ""));
+    boolean success = serverFile.mkdir();
+    if (!success) {
+      throw new IOException("Cannot mkdir for file " + serverFile);
+    }
+    serverDir = serverFile.getAbsolutePath();
     CommandStringBuilder command = new CommandStringBuilder(CliStrings.START_SERVER);
     command.addOption(CliStrings.START_SERVER__NAME, name);
     command.addOption(CliStrings.START_SERVER__SERVER_PORT, "0");
@@ -116,8 +122,14 @@ public abstract class TomcatSessionBackwardsCompatibilityTestBase {
     gfsh.executeAndAssertThat(command.toString()).statusIsSuccess();
   }
 
-  protected void startLocator(String name, String classPath, int port) throws Exception {
-    locatorDir = tempFolder.newFolder("locator").getPath();
+  protected void startLocator(String name, String classPath, int port) throws IOException {
+    File locatorFile = new File("locator_dir_" + this.getClass().getSimpleName() + "_"
+        + testName.getMethodName().replace("[", "").replace("]", ""));
+    boolean success = locatorFile.mkdir();
+    if (!success) {
+      throw new IOException("Cannot mkdir for file " + locatorFile);
+    }
+    locatorDir = locatorFile.getAbsolutePath();
     CommandStringBuilder locStarter = new CommandStringBuilder(CliStrings.START_LOCATOR);
     locStarter.addOption(CliStrings.START_LOCATOR__MEMBER_NAME, name);
     locStarter.addOption(CliStrings.START_LOCATOR__CLASSPATH, classPath);