Fix timing issue in test for STOMP Server
https://build.spring.io/browse/INT-MASTER-733 The Netty tries to load `netty-transport-native-epoll` too long, more then 10 seconds we expect in the `AbstractStompSessionManager`, therefore we end up having `StompConnectionFailedEvent` as a first event in the queue channel for STOMP events. * Increase connection wait timeout to `30 secs`, like it is in many other places in Spring * Provide some Java 8 style refactoring for the `AbstractStompSessionManager` * Fix `StompServerIntegrationTests` to poll events from queue until `StompSessionConnectedEvent` any way * Upgrade to Gradle 4.0 and `spring-io-plugin-0.0.8` * Bump `org.sonarqube` version to `2.5` - `2.1` isn't compatible with Gradle 4.0
This commit is contained in:
@@ -118,9 +118,13 @@ public class StompServerIntegrationTests extends LogAdjustingTestSupport {
|
||||
MessageChannel stompOutputChannel1 = context1.getBean("stompOutputChannel", MessageChannel.class);
|
||||
MessageChannel stompOutputChannel2 = context2.getBean("stompOutputChannel", MessageChannel.class);
|
||||
|
||||
Message<?> eventMessage = stompEvents1.receive(10000);
|
||||
Message<?> eventMessage;
|
||||
do {
|
||||
eventMessage = stompEvents1.receive(10000);
|
||||
}
|
||||
while (eventMessage != null && !(eventMessage.getPayload() instanceof StompSessionConnectedEvent));
|
||||
|
||||
assertNotNull(eventMessage);
|
||||
assertThat(eventMessage.getPayload(), instanceOf(StompSessionConnectedEvent.class));
|
||||
|
||||
eventMessage = stompEvents1.receive(10000);
|
||||
assertNotNull(eventMessage);
|
||||
|
||||
Reference in New Issue
Block a user