Skip to content

Commit f48d019

Browse files
artembilangaryrussell
authored andcommitted
INT-3909: Upgrade to Tomcat-8.0.33
JIRA: https://jira.spring.io/browse/INT-3909 Un`@Ignore` the `ClientWebSocketContainerTests` to ensure that `Tomcat-8.0.33` has the fix for the closed WebSocket session race condition. Fix `StompIntegrationTests` test data Clean up queue channels before each test, because of some remained extra messages during the web-socket protocol interactions, like socket close events or similar Fix `RedisStoreInboundChannelAdapterIntegrationTests` race conditions Since Jedis driver is async, we not always receive a reply from the `TX-sync` component immediately. And loop checking the Redis for the `key` after some `Thread.sleep()`
1 parent 9935491 commit f48d019

File tree

4 files changed

+25
-5
lines changed

4 files changed

+25
-5
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ subprojects { subproject ->
141141
saajImplVersion = '1.3.23'
142142
servletApiVersion = '3.1.0'
143143
slf4jVersion = "1.7.21"
144-
tomcatVersion = "8.0.30"
144+
tomcatVersion = "8.0.33"
145145
smackVersion = '4.1.6'
146146
springAmqpVersion = project.hasProperty('springAmqpVersion') ? project.springAmqpVersion : '1.6.0.BUILD-SNAPSHOT'
147147
// springCloudClusterVersion = '1.0.0.BUILD-SNAPSHOT'

spring-integration-redis/src/test/java/org/springframework/integration/redis/inbound/RedisStoreInboundChannelAdapterIntegrationTests.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2015 the original author or authors.
2+
* Copyright 2002-2016 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -94,6 +94,13 @@ public void testListInboundConfigurationWithSynchronization() throws Exception {
9494
//poll again, should get nothing since the collection was removed during synchronization
9595
message = (Message<Integer>) redisChannel.receive(100);
9696
assertNull(message);
97+
98+
int n = 0;
99+
while (n++ < 100 && template.keys("bar").size() == 0) {
100+
Thread.sleep(100);
101+
}
102+
assertTrue("Rename didn't occur", n < 100);
103+
97104
assertEquals(Long.valueOf(13), template.boundListOps("bar").size());
98105
template.delete("bar");
99106

@@ -161,6 +168,13 @@ public void testListInboundConfigurationWithSynchronizationAndTemplate() throws
161168
//poll again, should get nothing since the collection was removed during synchronization
162169
message = (Message<Integer>) redisChannel.receive(100);
163170
assertNull(message);
171+
172+
int n = 0;
173+
while (n++ < 100 && template.keys("bar").size() == 0) {
174+
Thread.sleep(100);
175+
}
176+
assertTrue("Rename didn't occur", n < 100);
177+
164178
assertEquals(Long.valueOf(13), template.boundListOps("bar").size());
165179
template.delete("bar");
166180

spring-integration-websocket/src/test/java/org/springframework/integration/websocket/ClientWebSocketContainerTests.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
import org.apache.tomcat.websocket.WsWebSocketContainer;
3636
import org.junit.AfterClass;
3737
import org.junit.BeforeClass;
38-
import org.junit.Ignore;
3938
import org.junit.Test;
4039

4140
import org.springframework.web.socket.CloseStatus;
@@ -64,7 +63,6 @@ public static void tearDown() throws Exception {
6463
}
6564

6665
@Test
67-
@Ignore("Ignored until fix for https://bz.apache.org/bugzilla/show_bug.cgi?id=58624")
6866
public void testClientWebSocketContainer() throws Exception {
6967
StandardWebSocketClient webSocketClient = new StandardWebSocketClient();
7068
Map<String, Object> userProperties = new HashMap<String, Object>();

spring-integration-websocket/src/test/java/org/springframework/integration/websocket/client/StompIntegrationTests.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import java.util.concurrent.CountDownLatch;
3232
import java.util.concurrent.TimeUnit;
3333

34+
import org.junit.Before;
3435
import org.junit.Test;
3536
import org.junit.runner.RunWith;
3637

@@ -125,7 +126,14 @@ public class StompIntegrationTests {
125126

126127
@Autowired
127128
@Qualifier("webSocketEvents")
128-
private PollableChannel webSocketEvents;
129+
private QueueChannel webSocketEvents;
130+
131+
@Before
132+
public void setup() {
133+
this.webSocketInputChannel.clear();
134+
this.webSocketEvents.clear();
135+
}
136+
129137

130138
@Test
131139
public void sendMessageToController() throws Exception {

0 commit comments

Comments
 (0)