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/10/01 14:45:34 UTC

[GitHub] [geode] jdeppe-pivotal opened a new pull request #5584: GEODE-8566: Redis native tests should not also stand up a Geode server

jdeppe-pivotal opened a new pull request #5584:
URL: https://github.com/apache/geode/pull/5584


   Thank you for submitting a contribution to Apache Geode.
   
   In order to streamline the review of the contribution we ask you
   to ensure the following steps have been taken:
   
   ### For all changes:
   - [ ] Is there a JIRA ticket associated with this PR? Is it referenced in the commit message?
   
   - [ ] Has your PR been rebased against the latest commit within the target branch (typically `develop`)?
   
   - [ ] Is your initial contribution a single, squashed commit?
   
   - [ ] Does `gradlew build` run cleanly?
   
   - [ ] Have you written or updated unit tests to verify your changes?
   
   - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
   
   ### Note:
   Please ensure that once the PR is submitted, check Concourse for build issues and
   submit an update to your PR as soon as possible. If you need help, please send an
   email to dev@geode.apache.org.
   


----------------------------------------------------------------
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] jdeppe-pivotal merged pull request #5584: GEODE-8566: Redis native tests should not also stand up a Geode server

Posted by GitBox <gi...@apache.org>.
jdeppe-pivotal merged pull request #5584:
URL: https://github.com/apache/geode/pull/5584


   


----------------------------------------------------------------
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] jdeppe-pivotal commented on a change in pull request #5584: GEODE-8566: Redis native tests should not also stand up a Geode server

Posted by GitBox <gi...@apache.org>.
jdeppe-pivotal commented on a change in pull request #5584:
URL: https://github.com/apache/geode/pull/5584#discussion_r499043152



##########
File path: geode-redis/src/acceptanceTest/java/org/apache/geode/redis/internal/executor/key/RenameNativeRedisAcceptanceTest.java
##########
@@ -14,30 +14,25 @@
  */
 package org.apache.geode.redis.internal.executor.key;
 
-import java.util.Random;
-
-import org.junit.BeforeClass;
 import org.junit.ClassRule;
 import org.junit.Ignore;
 import org.junit.Test;
-import redis.clients.jedis.Jedis;
 
 import org.apache.geode.NativeRedisTestRule;
 
-public class RenameNativeRedisAcceptanceTest extends RenameIntegrationTest {
+public class RenameNativeRedisAcceptanceTest extends AbstractRenameIntegrationTest {
+
   @ClassRule
   public static NativeRedisTestRule redis = new NativeRedisTestRule();
 
-  @BeforeClass
-  public static void setUp() {
-    rand = new Random();
-    jedis = new Jedis("localhost", redis.getPort(), 10000000);
-    jedis2 = new Jedis("localhost", redis.getPort(), 10000000);
-    jedis3 = new Jedis("localhost", redis.getPort(), 10000000);
+  @Override
+  public int getPort() {
+    return redis.getPort();
   }
 
   @Override
   @Test
   @Ignore("native redis does implement renamenx")
   public void renamenxIsUnimplemented() {}
+

Review comment:
       I decided to just delete the test. I created a story for us to implement `RENAMENX`.




----------------------------------------------------------------
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] jdeppe-pivotal commented on a change in pull request #5584: GEODE-8566: Redis native tests should not also stand up a Geode server

Posted by GitBox <gi...@apache.org>.
jdeppe-pivotal commented on a change in pull request #5584:
URL: https://github.com/apache/geode/pull/5584#discussion_r499042492



##########
File path: geode-redis/src/acceptanceTest/java/org/apache/geode/redis/internal/executor/pubsub/PubSubNativeRedisAcceptanceTest.java
##########
@@ -15,31 +15,14 @@
 
 package org.apache.geode.redis.internal.executor.pubsub;
 
-
-
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
 import org.junit.ClassRule;
-import redis.clients.jedis.Jedis;
 
 import org.apache.geode.NativeRedisTestRule;
 
-public class PubSubNativeRedisAcceptanceTest extends PubSubIntegrationTest {
+public class PubSubNativeRedisAcceptanceTest extends AbstractPubSubIntegrationTest {
   @ClassRule
   public static NativeRedisTestRule redis = new NativeRedisTestRule();
 
-  @BeforeClass
-  public static void setUp() {
-    subscriber = new Jedis("localhost", redis.getPort(), JEDIS_TIMEOUT);
-    publisher = new Jedis("localhost", redis.getPort(), JEDIS_TIMEOUT);
-  }
-
-  @AfterClass
-  public static void tearDown() {
-    subscriber.close();
-    publisher.close();
-  }
-
   public int getPort() {

Review comment:
       Yup




----------------------------------------------------------------
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] sabbey37 commented on a change in pull request #5584: GEODE-8566: Redis native tests should not also stand up a Geode server

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



##########
File path: geode-redis/src/acceptanceTest/java/org/apache/geode/redis/internal/executor/key/RenameNativeRedisAcceptanceTest.java
##########
@@ -14,30 +14,25 @@
  */
 package org.apache.geode.redis.internal.executor.key;
 
-import java.util.Random;
-
-import org.junit.BeforeClass;
 import org.junit.ClassRule;
 import org.junit.Ignore;
 import org.junit.Test;
-import redis.clients.jedis.Jedis;
 
 import org.apache.geode.NativeRedisTestRule;
 
-public class RenameNativeRedisAcceptanceTest extends RenameIntegrationTest {
+public class RenameNativeRedisAcceptanceTest extends AbstractRenameIntegrationTest {
+
   @ClassRule
   public static NativeRedisTestRule redis = new NativeRedisTestRule();
 
-  @BeforeClass
-  public static void setUp() {
-    rand = new Random();
-    jedis = new Jedis("localhost", redis.getPort(), 10000000);
-    jedis2 = new Jedis("localhost", redis.getPort(), 10000000);
-    jedis3 = new Jedis("localhost", redis.getPort(), 10000000);
+  @Override
+  public int getPort() {
+    return redis.getPort();
   }
 
   @Override
   @Test
   @Ignore("native redis does implement renamenx")
   public void renamenxIsUnimplemented() {}
+

Review comment:
       sounds good!




----------------------------------------------------------------
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] sabbey37 commented on a change in pull request #5584: GEODE-8566: Redis native tests should not also stand up a Geode server

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



##########
File path: geode-redis/src/acceptanceTest/java/org/apache/geode/redis/internal/executor/key/RenameNativeRedisAcceptanceTest.java
##########
@@ -14,30 +14,25 @@
  */
 package org.apache.geode.redis.internal.executor.key;
 
-import java.util.Random;
-
-import org.junit.BeforeClass;
 import org.junit.ClassRule;
 import org.junit.Ignore;
 import org.junit.Test;
-import redis.clients.jedis.Jedis;
 
 import org.apache.geode.NativeRedisTestRule;
 
-public class RenameNativeRedisAcceptanceTest extends RenameIntegrationTest {
+public class RenameNativeRedisAcceptanceTest extends AbstractRenameIntegrationTest {
+
   @ClassRule
   public static NativeRedisTestRule redis = new NativeRedisTestRule();
 
-  @BeforeClass
-  public static void setUp() {
-    rand = new Random();
-    jedis = new Jedis("localhost", redis.getPort(), 10000000);
-    jedis2 = new Jedis("localhost", redis.getPort(), 10000000);
-    jedis3 = new Jedis("localhost", redis.getPort(), 10000000);
+  @Override
+  public int getPort() {
+    return redis.getPort();
   }
 
   @Override
   @Test
   @Ignore("native redis does implement renamenx")
   public void renamenxIsUnimplemented() {}
+

Review comment:
       Should we move this test out of the `AbstractRenameIntegrationTest` file and into `RenameIntegrationTest` file like the `leakedSubscriptions` test (which is just in the `SubscriptionsIntegrationTest` file)?  Not sure which is better.




----------------------------------------------------------------
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] sabbey37 commented on a change in pull request #5584: GEODE-8566: Redis native tests should not also stand up a Geode server

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



##########
File path: geode-redis/src/acceptanceTest/java/org/apache/geode/redis/internal/executor/pubsub/PubSubNativeRedisAcceptanceTest.java
##########
@@ -15,31 +15,14 @@
 
 package org.apache.geode.redis.internal.executor.pubsub;
 
-
-
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
 import org.junit.ClassRule;
-import redis.clients.jedis.Jedis;
 
 import org.apache.geode.NativeRedisTestRule;
 
-public class PubSubNativeRedisAcceptanceTest extends PubSubIntegrationTest {
+public class PubSubNativeRedisAcceptanceTest extends AbstractPubSubIntegrationTest {
   @ClassRule
   public static NativeRedisTestRule redis = new NativeRedisTestRule();
 
-  @BeforeClass
-  public static void setUp() {
-    subscriber = new Jedis("localhost", redis.getPort(), JEDIS_TIMEOUT);
-    publisher = new Jedis("localhost", redis.getPort(), JEDIS_TIMEOUT);
-  }
-
-  @AfterClass
-  public static void tearDown() {
-    subscriber.close();
-    publisher.close();
-  }
-
   public int getPort() {

Review comment:
       Should `@Override` be added to this method?

##########
File path: geode-redis/src/acceptanceTest/java/org/apache/geode/redis/internal/executor/pubsub/PubSubNativeRedisAcceptanceTest.java
##########
@@ -15,31 +15,14 @@
 
 package org.apache.geode.redis.internal.executor.pubsub;
 
-
-
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
 import org.junit.ClassRule;
-import redis.clients.jedis.Jedis;
 
 import org.apache.geode.NativeRedisTestRule;
 
-public class PubSubNativeRedisAcceptanceTest extends PubSubIntegrationTest {
+public class PubSubNativeRedisAcceptanceTest extends AbstractPubSubIntegrationTest {
   @ClassRule
   public static NativeRedisTestRule redis = new NativeRedisTestRule();
 
-  @BeforeClass
-  public static void setUp() {
-    subscriber = new Jedis("localhost", redis.getPort(), JEDIS_TIMEOUT);
-    publisher = new Jedis("localhost", redis.getPort(), JEDIS_TIMEOUT);
-  }
-
-  @AfterClass
-  public static void tearDown() {
-    subscriber.close();
-    publisher.close();
-  }
-
   public int getPort() {

Review comment:
       Should we add `@Override` to this method?

##########
File path: geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/key/AbstractExpireIntegrationTest.java
##########
@@ -0,0 +1,339 @@
+/*
+ * 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.redis.internal.executor.key;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import redis.clients.jedis.Jedis;
+
+import org.apache.geode.test.dunit.rules.RedisPortSupplier;
+
+public abstract class AbstractExpireIntegrationTest implements RedisPortSupplier {
+
+  private Jedis jedis;
+  private static int REDIS_CLIENT_TIMEOUT = 10000000;

Review comment:
       This is not related to this PR, but I guess we should go through and make sure these timeouts are all set to `Math.toIntExact(GeodeAwaitility.getTimeout().toMillis());` at some point.




----------------------------------------------------------------
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] jdeppe-pivotal commented on a change in pull request #5584: GEODE-8566: Redis native tests should not also stand up a Geode server

Posted by GitBox <gi...@apache.org>.
jdeppe-pivotal commented on a change in pull request #5584:
URL: https://github.com/apache/geode/pull/5584#discussion_r499042866



##########
File path: geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/key/AbstractExpireIntegrationTest.java
##########
@@ -0,0 +1,339 @@
+/*
+ * 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.redis.internal.executor.key;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import redis.clients.jedis.Jedis;
+
+import org.apache.geode.test.dunit.rules.RedisPortSupplier;
+
+public abstract class AbstractExpireIntegrationTest implements RedisPortSupplier {
+
+  private Jedis jedis;
+  private static int REDIS_CLIENT_TIMEOUT = 10000000;

Review comment:
       Good idea - since I'm touching a lot of these files already.




----------------------------------------------------------------
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