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 20:05:13 UTC

[GitHub] [geode] sabbey37 commented on a change in pull request #5584: GEODE-8566: Redis native tests should not also stand up a Geode server

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