From 1012e588e4eafa45c721a5891c637902f84f0ce6 Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Thu, 22 Oct 2015 18:30:12 -0400 Subject: [PATCH] Increase `remoteTimeout` for TcpOutbound test Looks like `5000` isn't enough to wait for reply from server in high-loaded environment: https://build.spring.io/browse/INT-B41-JOB1-456 --- .../integration/ip/tcp/TcpOutboundGatewayTests.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/TcpOutboundGatewayTests.java b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/TcpOutboundGatewayTests.java index 7a20e3ecc3..364c0189bc 100644 --- a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/TcpOutboundGatewayTests.java +++ b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/TcpOutboundGatewayTests.java @@ -399,7 +399,7 @@ public class TcpOutboundGatewayTests { public Object answer(InvocationOnMock invocation) throws Throwable { if (!remoteTimeoutUsed.getAndSet(true)) { // increase the timeout after the first send - gateway.setRemoteTimeout(5000); + gateway.setRemoteTimeout(10000); } return invocation.callRealMethod(); } @@ -408,9 +408,10 @@ public class TcpOutboundGatewayTests { .getValue(Mockito.any(EvaluationContext.class), Matchers.any()); gateway.setRemoteTimeoutExpression(remoteTimeoutExpression); + @SuppressWarnings("unchecked") Future[] results = (Future[]) new Future[2]; - final CountDownLatch secondMessageLatch = new CountDownLatch(1); + for (int i = 0; i < 2; i++) { final int j = i; results[j] = (Executors.newSingleThreadExecutor().submit(new Callable() {