Increase timeouts for RedisQueueMDrEndpointTests

https://build.spring.io/browse/INT-MJATS41-999/

**Cherry-pick to 4.3.x**

(cherry picked from commit 94e5271a57)

Conflicts:
	spring-integration-redis/src/test/java/org/springframework/integration/redis/inbound/RedisQueueMessageDrivenEndpointTests.java
This commit is contained in:
Artem Bilan
2017-05-23 09:48:47 -04:00
parent a474ec1ee4
commit e73e89e14b

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2016 the original author or authors.
* Copyright 2013-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -67,6 +67,7 @@ import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.MessagingException;
import org.springframework.messaging.PollableChannel;
import org.springframework.messaging.support.ErrorMessage;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@@ -79,6 +80,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
*/
@ContextConfiguration
@RunWith(SpringJUnit4ClassRunner.class)
@DirtiesContext
public class RedisQueueMessageDrivenEndpointTests extends RedisAvailableTests {
@Autowired
@@ -121,7 +123,7 @@ public class RedisQueueMessageDrivenEndpointTests extends RedisAvailableTests {
new RedisQueueMessageDrivenEndpoint(queueName, this.connectionFactory);
endpoint.setBeanFactory(Mockito.mock(BeanFactory.class));
endpoint.setOutputChannel(channel);
endpoint.setReceiveTimeout(10000);
endpoint.setReceiveTimeout(10);
endpoint.afterPropertiesSet();
endpoint.start();
@@ -166,7 +168,7 @@ public class RedisQueueMessageDrivenEndpointTests extends RedisAvailableTests {
endpoint.setExpectMessage(true);
endpoint.setOutputChannel(channel);
endpoint.setErrorChannel(errorChannel);
endpoint.setReceiveTimeout(10000);
endpoint.setReceiveTimeout(10);
endpoint.afterPropertiesSet();
endpoint.start();
@@ -247,7 +249,7 @@ public class RedisQueueMessageDrivenEndpointTests extends RedisAvailableTests {
dfa.setPropertyValue("boundListOperations", boundListOperations);
endpoint.setBeanFactory(Mockito.mock(BeanFactory.class));
endpoint.setOutputChannel(new DirectChannel());
endpoint.setReceiveTimeout(10000);
endpoint.setReceiveTimeout(10);
ExecutorService executorService = Executors.newCachedThreadPool();
endpoint.setTaskExecutor(executorService);
@@ -272,9 +274,9 @@ public class RedisQueueMessageDrivenEndpointTests extends RedisAvailableTests {
});
executorService.shutdown();
assertTrue(executorService.awaitTermination(10, TimeUnit.SECONDS));
assertTrue(executorService.awaitTermination(20, TimeUnit.SECONDS));
assertTrue(stopLatch.await(10, TimeUnit.SECONDS));
assertTrue(stopLatch.await(21, TimeUnit.SECONDS));
Mockito.verify(boundListOperations, atLeastOnce()).rightPush(Mockito.any(byte[].class));
}
@@ -375,7 +377,7 @@ public class RedisQueueMessageDrivenEndpointTests extends RedisAvailableTests {
new RedisQueueMessageDrivenEndpoint(queueName, this.connectionFactory);
endpoint.setBeanFactory(Mockito.mock(BeanFactory.class));
endpoint.setOutputChannel(channel);
endpoint.setReceiveTimeout(10000);
endpoint.setReceiveTimeout(10);
endpoint.setRightPop(false);
endpoint.afterPropertiesSet();
endpoint.start();