diff --git a/src/test/java/org/springframework/data/redis/connection/AbstractConnectionIntegrationTests.java b/src/test/java/org/springframework/data/redis/connection/AbstractConnectionIntegrationTests.java index f110d208d..297105a58 100644 --- a/src/test/java/org/springframework/data/redis/connection/AbstractConnectionIntegrationTests.java +++ b/src/test/java/org/springframework/data/redis/connection/AbstractConnectionIntegrationTests.java @@ -771,7 +771,7 @@ public abstract class AbstractConnectionIntegrationTests { connection.unwatch(); connection.multi(); //Give some time for unwatch to be asynch executed - Thread.sleep(500); + Thread.sleep(100); DefaultStringRedisConnection conn2 = new DefaultStringRedisConnection( connectionFactory.getConnection()); conn2.set("testitnow", "something"); diff --git a/src/test/java/org/springframework/data/redis/listener/PubSubResubscribeTests.java b/src/test/java/org/springframework/data/redis/listener/PubSubResubscribeTests.java index 724e7bb1d..e2f56fdad 100644 --- a/src/test/java/org/springframework/data/redis/listener/PubSubResubscribeTests.java +++ b/src/test/java/org/springframework/data/redis/listener/PubSubResubscribeTests.java @@ -20,6 +20,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; +import static org.junit.Assume.assumeTrue; import java.util.ArrayList; import java.util.Arrays; @@ -34,12 +35,14 @@ import java.util.concurrent.TimeUnit; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Test; import org.springframework.beans.factory.DisposableBean; import org.springframework.core.task.SimpleAsyncTaskExecutor; import org.springframework.core.task.SyncTaskExecutor; import org.springframework.data.redis.ConnectionFactoryTracker; +import org.springframework.data.redis.RedisTestProfileValueSource; import org.springframework.data.redis.SettingsUtils; import org.springframework.data.redis.connection.RedisConnectionFactory; import org.springframework.data.redis.connection.jedis.JedisConnectionFactory; @@ -67,6 +70,11 @@ public class PubSubResubscribeTests { private final MessageListenerAdapter adapter = new MessageListenerAdapter(handler); + @BeforeClass + public static void shouldRun() { + assumeTrue(RedisTestProfileValueSource.matches("runLongTests", "true")); + } + @AfterClass public static void cleanUp() { ConnectionFactoryTracker.cleanUp(); diff --git a/src/test/java/org/springframework/data/redis/listener/PubSubTests.java b/src/test/java/org/springframework/data/redis/listener/PubSubTests.java index 71ee2dad7..a659b9da9 100644 --- a/src/test/java/org/springframework/data/redis/listener/PubSubTests.java +++ b/src/test/java/org/springframework/data/redis/listener/PubSubTests.java @@ -18,6 +18,7 @@ package org.springframework.data.redis.listener; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertThat; +import static org.junit.Assume.assumeTrue; import static org.junit.matchers.JUnitMatchers.hasItems; import java.util.Arrays; @@ -31,6 +32,7 @@ import java.util.concurrent.TimeUnit; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; @@ -39,6 +41,7 @@ import org.springframework.core.task.SimpleAsyncTaskExecutor; import org.springframework.core.task.SyncTaskExecutor; import org.springframework.data.redis.ConnectionFactoryTracker; import org.springframework.data.redis.ObjectFactory; +import org.springframework.data.redis.RedisTestProfileValueSource; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.listener.adapter.MessageListenerAdapter; @@ -69,6 +72,11 @@ public class PubSubTests { private final MessageListenerAdapter adapter = new MessageListenerAdapter(handler); + @BeforeClass + public static void shouldRun() { + assumeTrue(RedisTestProfileValueSource.matches("runLongTests", "true")); + } + @Before public void setUp() throws Exception { bag.clear();