Skip to content

Commit 1af8844

Browse files
committed
remove anti-logical tests for sharded pool
1 parent 36f0f61 commit 1af8844

File tree

2 files changed

+0
-88
lines changed

2 files changed

+0
-88
lines changed

src/test/java/redis/clients/jedis/tests/ShardedJedisPoolTest.java

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -137,50 +137,6 @@ public void checkFailedJedisServer() {
137137
pool.destroy();
138138
}
139139

140-
@Ignore
141-
@Test
142-
public void shouldReturnActiveShardsWhenOneGoesOffline() {
143-
GenericObjectPoolConfig redisConfig = new GenericObjectPoolConfig();
144-
redisConfig.setTestOnBorrow(false);
145-
ShardedJedisPool pool = new ShardedJedisPool(redisConfig, shards);
146-
ShardedJedis jedis = pool.getResource();
147-
// fill the shards
148-
for (int i = 0; i < 1000; i++) {
149-
jedis.set("a-test-" + i, "0");
150-
}
151-
jedis.close();
152-
// check quantity for each shard
153-
Jedis j = new Jedis(shards.get(0));
154-
j.connect();
155-
Long c1 = j.dbSize();
156-
j.disconnect();
157-
j = new Jedis(shards.get(1));
158-
j.connect();
159-
Long c2 = j.dbSize();
160-
j.disconnect();
161-
// shutdown shard 2 and check thay the pool returns an instance with c1
162-
// items on one shard
163-
// alter shard 1 and recreate pool
164-
pool.destroy();
165-
shards.set(1, new JedisShardInfo("localhost", 1234));
166-
pool = new ShardedJedisPool(redisConfig, shards);
167-
jedis = pool.getResource();
168-
long actual = 0;
169-
long fails = 0;
170-
for (int i = 0; i < 1000; i++) {
171-
try {
172-
jedis.get("a-test-" + i);
173-
actual++;
174-
} catch (RuntimeException e) {
175-
fails++;
176-
}
177-
}
178-
jedis.close();
179-
pool.destroy();
180-
assertEquals(Long.valueOf(actual), c1);
181-
assertEquals(Long.valueOf(fails), c2);
182-
}
183-
184140
@Test
185141
public void startWithUrlString() {
186142
Jedis j = new Jedis("localhost", 6380);

src/test/java/redis/clients/jedis/tests/ShardedJedisPoolWithCompleteCredentialsTest.java

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -146,50 +146,6 @@ public void checkFailedJedisServer() {
146146
pool.destroy();
147147
}
148148

149-
@Ignore
150-
@Test
151-
public void shouldReturnActiveShardsWhenOneGoesOffline() {
152-
GenericObjectPoolConfig redisConfig = new GenericObjectPoolConfig();
153-
redisConfig.setTestOnBorrow(false);
154-
ShardedJedisPool pool = new ShardedJedisPool(redisConfig, shards);
155-
ShardedJedis jedis = pool.getResource();
156-
// fill the shards
157-
for (int i = 0; i < 1000; i++) {
158-
jedis.set("a-test-" + i, "0");
159-
}
160-
jedis.close();
161-
// check quantity for each shard
162-
Jedis j = new Jedis(shards.get(0));
163-
j.connect();
164-
Long c1 = j.dbSize();
165-
j.disconnect();
166-
j = new Jedis(shards.get(1));
167-
j.connect();
168-
Long c2 = j.dbSize();
169-
j.disconnect();
170-
// shutdown shard 2 and check thay the pool returns an instance with c1
171-
// items on one shard
172-
// alter shard 1 and recreate pool
173-
pool.destroy();
174-
shards.set(1, new JedisShardInfo("localhost", 1234));
175-
pool = new ShardedJedisPool(redisConfig, shards);
176-
jedis = pool.getResource();
177-
long actual = 0;
178-
long fails = 0;
179-
for (int i = 0; i < 1000; i++) {
180-
try {
181-
jedis.get("a-test-" + i);
182-
actual++;
183-
} catch (RuntimeException e) {
184-
fails++;
185-
}
186-
}
187-
jedis.close();
188-
pool.destroy();
189-
assertEquals(Long.valueOf(actual), c1);
190-
assertEquals(Long.valueOf(fails), c2);
191-
}
192-
193149
@Test
194150
public void startWithUrlString() {
195151
Jedis j = new Jedis("localhost", 6380);

0 commit comments

Comments
 (0)