Skip to content

Commit

Permalink
GEODE-8211: Fix flaky test by increasing client timeout (apache#5213)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdeppe-pivotal authored Jun 4, 2020
1 parent 80ad8dd commit 77d4bf8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ protected void before() throws Throwable {
server.start();
}

public GeodeRedisServerRule withProperty(String property, String value) {
cacheFactory.set(property, value);
return this;
}

@Override
protected void after() {
cache.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@

package org.apache.geode.redis.general;

import static org.apache.geode.distributed.ConfigurationProperties.LOG_LEVEL;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;

import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import redis.clients.jedis.Jedis;
Expand All @@ -32,10 +32,11 @@
public class ShutdownIntegrationTest {

public Jedis jedis;
public static int REDIS_CLIENT_TIMEOUT = 1000;
public static int REDIS_CLIENT_TIMEOUT = 10000;

@Rule
public GeodeRedisServerRule server = new GeodeRedisServerRule();
public GeodeRedisServerRule server = new GeodeRedisServerRule()
.withProperty(LOG_LEVEL, "info");

@Before
public void setUp() {
Expand All @@ -57,18 +58,13 @@ public void shutdownActuallyShutsDownTheServer() {
}

@Test
@Ignore("GEODE-8211")
public void shutdownIsDisabled_whenOnlySupportedCommandsAreAllowed() {
server.getServer().setAllowUnsupportedCommands(false);

// Unfortunately Jedis' shutdown() doesn't seem to throw a JedisDataException when the command
// returns an error.
jedis.shutdown();

// the old jedis client may be closed by shutdown even though disabled on server

Jedis jedis2 = new Jedis("localhost", server.getPort(), REDIS_CLIENT_TIMEOUT);
assertThat(jedis2.keys("*")).isEmpty();
jedis2.close();
assertThat(jedis.keys("*")).isEmpty();
}
}

0 comments on commit 77d4bf8

Please sign in to comment.