You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2020/06/17 19:48:55 UTC

[GitHub] [geode] kirklund opened a new pull request #5268: GEODE-8250: Create new custom log config acceptance tests

kirklund opened a new pull request #5268:
URL: https://github.com/apache/geode/pull/5268


   New tests to discover and verify that use of custom log configs works
   when using GFSH to start Locator and Server.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] kirklund commented on a change in pull request #5268: GEODE-8250: Create new custom log config acceptance tests

Posted by GitBox <gi...@apache.org>.
kirklund commented on a change in pull request #5268:
URL: https://github.com/apache/geode/pull/5268#discussion_r444477471



##########
File path: geode-assembly/src/acceptanceTest/java/org/apache/geode/logging/LocatorWithCustomLogConfigAcceptanceTest.java
##########
@@ -0,0 +1,291 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.geode.logging;
+
+import static java.nio.file.Files.copy;
+import static org.apache.geode.internal.AvailablePortHelper.getRandomAvailableTCPPorts;
+import static org.apache.geode.test.assertj.LogFileAssert.assertThat;
+import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
+import static org.apache.geode.test.util.ResourceUtils.createFileFromResource;
+import static org.apache.geode.test.util.ResourceUtils.getResource;
+
+import java.nio.file.Path;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
+import org.junit.rules.TestName;
+
+import org.apache.geode.test.junit.rules.RequiresGeodeHome;
+import org.apache.geode.test.junit.rules.gfsh.GfshRule;
+
+public class LocatorWithCustomLogConfigAcceptanceTest {
+
+  private static final String CONFIG_WITH_GEODE_PLUGINS_FILE_NAME =
+      "LocatorWithCustomLogConfigAcceptanceTestWithGeodePlugins.xml";
+  private static final String CONFIG_WITHOUT_GEODE_PLUGINS_FILE_NAME =
+      "LocatorWithCustomLogConfigAcceptanceTestWithoutGeodePlugins.xml";
+
+  private String locatorName;
+  private Path workingDir;
+  private int locatorPort;
+  private int httpPort;
+  private int rmiPort;
+  private Path configWithGeodePluginsFile;
+  private Path configWithoutGeodePluginsFile;
+  private Path locatorLogFile;
+  private Path pulseLogFile;
+  private Path customLogFile;
+
+  @Rule
+  public GfshRule gfshRule = new GfshRule();
+  @Rule
+  public RequiresGeodeHome requiresGeodeHome = new RequiresGeodeHome();
+  @Rule
+  public TemporaryFolder temporaryFolder = new TemporaryFolder();
+  @Rule
+  public TestName testName = new TestName();
+
+  @Before
+  public void setUpLogConfigFiles() {
+    configWithGeodePluginsFile = createFileFromResource(
+        getResource(CONFIG_WITH_GEODE_PLUGINS_FILE_NAME), temporaryFolder.getRoot(),
+        CONFIG_WITH_GEODE_PLUGINS_FILE_NAME)
+            .toPath();
+
+    configWithoutGeodePluginsFile = createFileFromResource(
+        getResource(CONFIG_WITHOUT_GEODE_PLUGINS_FILE_NAME), temporaryFolder.getRoot(),
+        CONFIG_WITHOUT_GEODE_PLUGINS_FILE_NAME)
+            .toPath();
+  }
+
+  @Before
+  public void setUpOutputFiles() {
+    locatorName = testName.getMethodName();
+
+    workingDir = temporaryFolder.getRoot().toPath().toAbsolutePath();
+    locatorLogFile = workingDir.resolve(locatorName + ".log");
+    pulseLogFile = workingDir.resolve("pulse.log");
+    customLogFile = workingDir.resolve("custom.log");
+  }
+
+  @Before
+  public void setUpRandomPorts() {
+    int[] ports = getRandomAvailableTCPPorts(3);
+
+    locatorPort = ports[0];
+    httpPort = ports[1];
+    rmiPort = ports[2];
+  }
+
+  @After
+  public void stopLocator() {
+    gfshRule.execute("stop locator --dir=" + workingDir);

Review comment:
       Looks like GfshRule is setup to really only work one way and that's to be 100% hands off with workingDir but the problem is I need the workingDir to contain the log4j2.xml and I need to add the workingDir to the classpath. When I do this, GfshRule fails to stop any processes.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] kirklund commented on a change in pull request #5268: GEODE-8250: Create new custom log config acceptance tests

Posted by GitBox <gi...@apache.org>.
kirklund commented on a change in pull request #5268:
URL: https://github.com/apache/geode/pull/5268#discussion_r444476057



##########
File path: geode-assembly/src/acceptanceTest/java/org/apache/geode/logging/LocatorWithCustomLogConfigAcceptanceTest.java
##########
@@ -0,0 +1,291 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.geode.logging;
+
+import static java.nio.file.Files.copy;
+import static org.apache.geode.internal.AvailablePortHelper.getRandomAvailableTCPPorts;
+import static org.apache.geode.test.assertj.LogFileAssert.assertThat;
+import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
+import static org.apache.geode.test.util.ResourceUtils.createFileFromResource;
+import static org.apache.geode.test.util.ResourceUtils.getResource;
+
+import java.nio.file.Path;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
+import org.junit.rules.TestName;
+
+import org.apache.geode.test.junit.rules.RequiresGeodeHome;
+import org.apache.geode.test.junit.rules.gfsh.GfshRule;
+
+public class LocatorWithCustomLogConfigAcceptanceTest {
+
+  private static final String CONFIG_WITH_GEODE_PLUGINS_FILE_NAME =
+      "LocatorWithCustomLogConfigAcceptanceTestWithGeodePlugins.xml";
+  private static final String CONFIG_WITHOUT_GEODE_PLUGINS_FILE_NAME =
+      "LocatorWithCustomLogConfigAcceptanceTestWithoutGeodePlugins.xml";
+
+  private String locatorName;
+  private Path workingDir;
+  private int locatorPort;
+  private int httpPort;
+  private int rmiPort;
+  private Path configWithGeodePluginsFile;
+  private Path configWithoutGeodePluginsFile;
+  private Path locatorLogFile;
+  private Path pulseLogFile;
+  private Path customLogFile;
+
+  @Rule
+  public GfshRule gfshRule = new GfshRule();
+  @Rule
+  public RequiresGeodeHome requiresGeodeHome = new RequiresGeodeHome();
+  @Rule
+  public TemporaryFolder temporaryFolder = new TemporaryFolder();
+  @Rule
+  public TestName testName = new TestName();
+
+  @Before
+  public void setUpLogConfigFiles() {
+    configWithGeodePluginsFile = createFileFromResource(
+        getResource(CONFIG_WITH_GEODE_PLUGINS_FILE_NAME), temporaryFolder.getRoot(),
+        CONFIG_WITH_GEODE_PLUGINS_FILE_NAME)
+            .toPath();
+
+    configWithoutGeodePluginsFile = createFileFromResource(
+        getResource(CONFIG_WITHOUT_GEODE_PLUGINS_FILE_NAME), temporaryFolder.getRoot(),
+        CONFIG_WITHOUT_GEODE_PLUGINS_FILE_NAME)
+            .toPath();
+  }
+
+  @Before
+  public void setUpOutputFiles() {
+    locatorName = testName.getMethodName();
+
+    workingDir = temporaryFolder.getRoot().toPath().toAbsolutePath();
+    locatorLogFile = workingDir.resolve(locatorName + ".log");
+    pulseLogFile = workingDir.resolve("pulse.log");
+    customLogFile = workingDir.resolve("custom.log");
+  }
+
+  @Before
+  public void setUpRandomPorts() {
+    int[] ports = getRandomAvailableTCPPorts(3);
+
+    locatorPort = ports[0];
+    httpPort = ports[1];
+    rmiPort = ports[2];
+  }
+
+  @After
+  public void stopLocator() {
+    gfshRule.execute("stop locator --dir=" + workingDir);
+  }
+
+  @Test
+  public void locatorLauncherUsesDefaultLoggingConfig() {
+    String startLocatorCommand = String.join(" ",
+        "start locator",
+        "--name=" + locatorName,
+        "--dir=" + workingDir,

Review comment:
       Unfortunately, some of these tests need to add a log4j2.xml file into the classpath (ie, in the workingDir which is then added to the classpath). I've tried making the changes you recommend, but GfshRule does leave the processes around -- it doesn't succeed in stopping them.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] kirklund merged pull request #5268: GEODE-8250: Create new custom log config acceptance tests

Posted by GitBox <gi...@apache.org>.
kirklund merged pull request #5268:
URL: https://github.com/apache/geode/pull/5268


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] jinmeiliao commented on a change in pull request #5268: GEODE-8250: Create new custom log config acceptance tests

Posted by GitBox <gi...@apache.org>.
jinmeiliao commented on a change in pull request #5268:
URL: https://github.com/apache/geode/pull/5268#discussion_r442387862



##########
File path: geode-assembly/src/acceptanceTest/java/org/apache/geode/logging/LocatorWithCustomLogConfigAcceptanceTest.java
##########
@@ -0,0 +1,291 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.geode.logging;
+
+import static java.nio.file.Files.copy;
+import static org.apache.geode.internal.AvailablePortHelper.getRandomAvailableTCPPorts;
+import static org.apache.geode.test.assertj.LogFileAssert.assertThat;
+import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
+import static org.apache.geode.test.util.ResourceUtils.createFileFromResource;
+import static org.apache.geode.test.util.ResourceUtils.getResource;
+
+import java.nio.file.Path;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
+import org.junit.rules.TestName;
+
+import org.apache.geode.test.junit.rules.RequiresGeodeHome;
+import org.apache.geode.test.junit.rules.gfsh.GfshRule;
+
+public class LocatorWithCustomLogConfigAcceptanceTest {
+
+  private static final String CONFIG_WITH_GEODE_PLUGINS_FILE_NAME =
+      "LocatorWithCustomLogConfigAcceptanceTestWithGeodePlugins.xml";
+  private static final String CONFIG_WITHOUT_GEODE_PLUGINS_FILE_NAME =
+      "LocatorWithCustomLogConfigAcceptanceTestWithoutGeodePlugins.xml";
+
+  private String locatorName;
+  private Path workingDir;
+  private int locatorPort;
+  private int httpPort;
+  private int rmiPort;
+  private Path configWithGeodePluginsFile;
+  private Path configWithoutGeodePluginsFile;
+  private Path locatorLogFile;
+  private Path pulseLogFile;
+  private Path customLogFile;
+
+  @Rule
+  public GfshRule gfshRule = new GfshRule();
+  @Rule
+  public RequiresGeodeHome requiresGeodeHome = new RequiresGeodeHome();
+  @Rule
+  public TemporaryFolder temporaryFolder = new TemporaryFolder();
+  @Rule
+  public TestName testName = new TestName();
+
+  @Before
+  public void setUpLogConfigFiles() {
+    configWithGeodePluginsFile = createFileFromResource(
+        getResource(CONFIG_WITH_GEODE_PLUGINS_FILE_NAME), temporaryFolder.getRoot(),
+        CONFIG_WITH_GEODE_PLUGINS_FILE_NAME)
+            .toPath();
+
+    configWithoutGeodePluginsFile = createFileFromResource(
+        getResource(CONFIG_WITHOUT_GEODE_PLUGINS_FILE_NAME), temporaryFolder.getRoot(),
+        CONFIG_WITHOUT_GEODE_PLUGINS_FILE_NAME)
+            .toPath();
+  }
+
+  @Before
+  public void setUpOutputFiles() {
+    locatorName = testName.getMethodName();
+
+    workingDir = temporaryFolder.getRoot().toPath().toAbsolutePath();
+    locatorLogFile = workingDir.resolve(locatorName + ".log");
+    pulseLogFile = workingDir.resolve("pulse.log");
+    customLogFile = workingDir.resolve("custom.log");
+  }
+
+  @Before
+  public void setUpRandomPorts() {
+    int[] ports = getRandomAvailableTCPPorts(3);
+
+    locatorPort = ports[0];
+    httpPort = ports[1];
+    rmiPort = ports[2];
+  }
+
+  @After
+  public void stopLocator() {
+    gfshRule.execute("stop locator --dir=" + workingDir);

Review comment:
       GfshRule itself will try to stop all the processes it starts using the rule if you allow it to host the working dir of all the servers/locators it started. Using the gfshRule.getWorkingDir will get the temp folder that gfsh uses and all the servers/locators' working dir will be under there. That way, when tests finish, GfshRule will kill all the members automatically.

##########
File path: geode-assembly/src/acceptanceTest/java/org/apache/geode/logging/LocatorWithCustomLogConfigAcceptanceTest.java
##########
@@ -0,0 +1,291 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.geode.logging;
+
+import static java.nio.file.Files.copy;
+import static org.apache.geode.internal.AvailablePortHelper.getRandomAvailableTCPPorts;
+import static org.apache.geode.test.assertj.LogFileAssert.assertThat;
+import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
+import static org.apache.geode.test.util.ResourceUtils.createFileFromResource;
+import static org.apache.geode.test.util.ResourceUtils.getResource;
+
+import java.nio.file.Path;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
+import org.junit.rules.TestName;
+
+import org.apache.geode.test.junit.rules.RequiresGeodeHome;
+import org.apache.geode.test.junit.rules.gfsh.GfshRule;
+
+public class LocatorWithCustomLogConfigAcceptanceTest {
+
+  private static final String CONFIG_WITH_GEODE_PLUGINS_FILE_NAME =
+      "LocatorWithCustomLogConfigAcceptanceTestWithGeodePlugins.xml";
+  private static final String CONFIG_WITHOUT_GEODE_PLUGINS_FILE_NAME =
+      "LocatorWithCustomLogConfigAcceptanceTestWithoutGeodePlugins.xml";
+
+  private String locatorName;
+  private Path workingDir;
+  private int locatorPort;
+  private int httpPort;
+  private int rmiPort;
+  private Path configWithGeodePluginsFile;
+  private Path configWithoutGeodePluginsFile;
+  private Path locatorLogFile;
+  private Path pulseLogFile;
+  private Path customLogFile;
+
+  @Rule
+  public GfshRule gfshRule = new GfshRule();
+  @Rule
+  public RequiresGeodeHome requiresGeodeHome = new RequiresGeodeHome();

Review comment:
       in order to use GfshRule you have to have geode home set already (it will give you an error if you don't). so you don't really need this rule here.

##########
File path: geode-assembly/src/acceptanceTest/java/org/apache/geode/logging/LocatorWithCustomLogConfigAcceptanceTest.java
##########
@@ -0,0 +1,291 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.geode.logging;
+
+import static java.nio.file.Files.copy;
+import static org.apache.geode.internal.AvailablePortHelper.getRandomAvailableTCPPorts;
+import static org.apache.geode.test.assertj.LogFileAssert.assertThat;
+import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
+import static org.apache.geode.test.util.ResourceUtils.createFileFromResource;
+import static org.apache.geode.test.util.ResourceUtils.getResource;
+
+import java.nio.file.Path;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
+import org.junit.rules.TestName;
+
+import org.apache.geode.test.junit.rules.RequiresGeodeHome;
+import org.apache.geode.test.junit.rules.gfsh.GfshRule;
+
+public class LocatorWithCustomLogConfigAcceptanceTest {
+
+  private static final String CONFIG_WITH_GEODE_PLUGINS_FILE_NAME =
+      "LocatorWithCustomLogConfigAcceptanceTestWithGeodePlugins.xml";
+  private static final String CONFIG_WITHOUT_GEODE_PLUGINS_FILE_NAME =
+      "LocatorWithCustomLogConfigAcceptanceTestWithoutGeodePlugins.xml";
+
+  private String locatorName;
+  private Path workingDir;
+  private int locatorPort;
+  private int httpPort;
+  private int rmiPort;
+  private Path configWithGeodePluginsFile;
+  private Path configWithoutGeodePluginsFile;
+  private Path locatorLogFile;
+  private Path pulseLogFile;
+  private Path customLogFile;
+
+  @Rule
+  public GfshRule gfshRule = new GfshRule();
+  @Rule
+  public RequiresGeodeHome requiresGeodeHome = new RequiresGeodeHome();
+  @Rule
+  public TemporaryFolder temporaryFolder = new TemporaryFolder();
+  @Rule
+  public TestName testName = new TestName();
+
+  @Before
+  public void setUpLogConfigFiles() {
+    configWithGeodePluginsFile = createFileFromResource(
+        getResource(CONFIG_WITH_GEODE_PLUGINS_FILE_NAME), temporaryFolder.getRoot(),
+        CONFIG_WITH_GEODE_PLUGINS_FILE_NAME)
+            .toPath();
+
+    configWithoutGeodePluginsFile = createFileFromResource(
+        getResource(CONFIG_WITHOUT_GEODE_PLUGINS_FILE_NAME), temporaryFolder.getRoot(),
+        CONFIG_WITHOUT_GEODE_PLUGINS_FILE_NAME)
+            .toPath();
+  }
+
+  @Before
+  public void setUpOutputFiles() {
+    locatorName = testName.getMethodName();
+
+    workingDir = temporaryFolder.getRoot().toPath().toAbsolutePath();
+    locatorLogFile = workingDir.resolve(locatorName + ".log");
+    pulseLogFile = workingDir.resolve("pulse.log");
+    customLogFile = workingDir.resolve("custom.log");
+  }
+
+  @Before
+  public void setUpRandomPorts() {
+    int[] ports = getRandomAvailableTCPPorts(3);
+
+    locatorPort = ports[0];
+    httpPort = ports[1];
+    rmiPort = ports[2];
+  }
+
+  @After
+  public void stopLocator() {
+    gfshRule.execute("stop locator --dir=" + workingDir);
+  }
+
+  @Test
+  public void locatorLauncherUsesDefaultLoggingConfig() {
+    String startLocatorCommand = String.join(" ",
+        "start locator",
+        "--name=" + locatorName,
+        "--dir=" + workingDir,

Review comment:
       so basically, no need to give a dir here if you allow gfshrule to manage the dir




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] kirklund edited a comment on pull request #5268: GEODE-8250: Create new custom log config acceptance tests

Posted by GitBox <gi...@apache.org>.
kirklund edited a comment on pull request #5268:
URL: https://github.com/apache/geode/pull/5268#issuecomment-648391431


   @jinmeiliao I'm going to request a re-review. I'm not able to remove my manipulation of TemporaryFolder and I don't want to spend more time trying to debug why GfshRule doesn't stop its processes. 
   
   These tests prove that custom logging config work (we now have a 2nd customer having trouble). I'd like to get these merged into develop and move onto blog article about how the customer/user can specify and use custom logging config instead of fighting with GfshRule.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] kirklund commented on pull request #5268: GEODE-8250: Create new custom log config acceptance tests

Posted by GitBox <gi...@apache.org>.
kirklund commented on pull request #5268:
URL: https://github.com/apache/geode/pull/5268#issuecomment-648391431


   @jinmeiliao I'm going to request a re-review. I'm not able to remove my manipulation of TemporaryFolder and I don't want to spend more time trying to debug why GfshRule doesn't stop its processes.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] kirklund commented on a change in pull request #5268: GEODE-8250: Create new custom log config acceptance tests

Posted by GitBox <gi...@apache.org>.
kirklund commented on a change in pull request #5268:
URL: https://github.com/apache/geode/pull/5268#discussion_r444476417



##########
File path: geode-assembly/src/acceptanceTest/java/org/apache/geode/logging/LocatorWithCustomLogConfigAcceptanceTest.java
##########
@@ -0,0 +1,291 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.geode.logging;
+
+import static java.nio.file.Files.copy;
+import static org.apache.geode.internal.AvailablePortHelper.getRandomAvailableTCPPorts;
+import static org.apache.geode.test.assertj.LogFileAssert.assertThat;
+import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
+import static org.apache.geode.test.util.ResourceUtils.createFileFromResource;
+import static org.apache.geode.test.util.ResourceUtils.getResource;
+
+import java.nio.file.Path;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
+import org.junit.rules.TestName;
+
+import org.apache.geode.test.junit.rules.RequiresGeodeHome;
+import org.apache.geode.test.junit.rules.gfsh.GfshRule;
+
+public class LocatorWithCustomLogConfigAcceptanceTest {
+
+  private static final String CONFIG_WITH_GEODE_PLUGINS_FILE_NAME =
+      "LocatorWithCustomLogConfigAcceptanceTestWithGeodePlugins.xml";
+  private static final String CONFIG_WITHOUT_GEODE_PLUGINS_FILE_NAME =
+      "LocatorWithCustomLogConfigAcceptanceTestWithoutGeodePlugins.xml";
+
+  private String locatorName;
+  private Path workingDir;
+  private int locatorPort;
+  private int httpPort;
+  private int rmiPort;
+  private Path configWithGeodePluginsFile;
+  private Path configWithoutGeodePluginsFile;
+  private Path locatorLogFile;
+  private Path pulseLogFile;
+  private Path customLogFile;
+
+  @Rule
+  public GfshRule gfshRule = new GfshRule();
+  @Rule
+  public RequiresGeodeHome requiresGeodeHome = new RequiresGeodeHome();

Review comment:
       This change worked, but the other two changes don't work even after I removed the TemporaryFolder and use gfshRule.getTemporaryFolder().




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org