Skip to content

Commit 8506716

Browse files
committed
Disable some time-sensitive tests on CI
**Cherry-pick to `5.5.x`**
1 parent 92630dd commit 8506716

File tree

4 files changed

+18
-11
lines changed

4 files changed

+18
-11
lines changed

spring-integration-core/src/test/java/org/springframework/integration/aggregator/FluxAggregatorMessageHandlerTests.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019 the original author or authors.
2+
* Copyright 2019-2022 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.
@@ -25,8 +25,8 @@
2525
import java.util.stream.Collectors;
2626
import java.util.stream.IntStream;
2727

28-
import org.junit.jupiter.api.Disabled;
2928
import org.junit.jupiter.api.Test;
29+
import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable;
3030

3131
import org.springframework.integration.IntegrationMessageHeaderAccessor;
3232
import org.springframework.integration.channel.QueueChannel;
@@ -158,7 +158,8 @@ void testCustomCombineFunction() {
158158
}
159159

160160
@Test
161-
@Disabled("Time-sensitive")
161+
@DisabledIfEnvironmentVariable(named = "bamboo_buildKey", matches = ".*?",
162+
disabledReason = "Timing is too short for CI")
162163
void testWindowTimespan() {
163164
QueueChannel resultChannel = new QueueChannel();
164165
FluxAggregatorMessageHandler fluxAggregatorMessageHandler = new FluxAggregatorMessageHandler();

spring-integration-core/src/test/java/org/springframework/integration/endpoint/ReactiveMessageSourceProducerTests.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020 the original author or authors.
2+
* Copyright 2020-2022 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.
@@ -26,6 +26,7 @@
2626
import java.util.stream.IntStream;
2727

2828
import org.junit.jupiter.api.Test;
29+
import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable;
2930

3031
import org.springframework.beans.factory.BeanFactory;
3132
import org.springframework.integration.IntegrationMessageHeaderAccessor;
@@ -46,6 +47,8 @@
4647
public class ReactiveMessageSourceProducerTests {
4748

4849
@Test
50+
@DisabledIfEnvironmentVariable(named = "bamboo_buildKey", matches = ".*?",
51+
disabledReason = "Timing is too short for CI")
4952
void testReactiveMessageSourceProducing() {
5053
LinkedBlockingQueue<Integer> queue =
5154
IntStream.range(0, 10)

spring-integration-core/src/test/java/org/springframework/integration/handler/DelayHandlerTests.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333

3434
import org.junit.jupiter.api.AfterEach;
3535
import org.junit.jupiter.api.BeforeEach;
36-
import org.junit.jupiter.api.Disabled;
3736
import org.junit.jupiter.api.Test;
37+
import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable;
3838
import org.mockito.Mockito;
3939

4040
import org.springframework.beans.DirectFieldAccessor;
@@ -415,8 +415,9 @@ public void defaultErrorChannelAndHandlerThrowsExceptionWithDelay() {
415415
assertThat(resultHandler.lastThread).isNotSameAs(Thread.currentThread());
416416
}
417417

418-
@Test //INT-1132
419-
@Disabled("Time-sensitive: no guarantee that message won't be released in between 'sleep' and 'destroy'")
418+
@Test
419+
@DisabledIfEnvironmentVariable(named = "bamboo_buildKey", matches = ".*?",
420+
disabledReason = "Timing is too short for CI")
420421
public void testReschedulePersistedMessagesOnStartup() throws Exception {
421422
MessageGroupStore messageGroupStore = new SimpleMessageStore();
422423
this.delayHandler.setDefaultDelay(2000);

spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/mysql/MySqlJdbcMessageStoreTests.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2022 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.
@@ -30,8 +30,8 @@
3030
import org.apache.commons.logging.LogFactory;
3131
import org.junit.jupiter.api.AfterEach;
3232
import org.junit.jupiter.api.BeforeEach;
33-
import org.junit.jupiter.api.Disabled;
3433
import org.junit.jupiter.api.Test;
34+
import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable;
3535

3636
import org.springframework.beans.factory.annotation.Autowired;
3737
import org.springframework.beans.factory.annotation.Value;
@@ -325,7 +325,8 @@ public void testOrderInMessageGroup() throws Exception {
325325

326326
@Test
327327
@Transactional
328-
@Disabled("Time sensitive")
328+
@DisabledIfEnvironmentVariable(named = "bamboo_buildKey", matches = ".*?",
329+
disabledReason = "Timing is too short for CI")
329330
public void testExpireMessageGroupOnCreateOnly() throws Exception {
330331
String groupId = "X";
331332
Message<String> message = MessageBuilder.withPayload("foo").setCorrelationId(groupId).build();
@@ -345,7 +346,8 @@ public void testExpireMessageGroupOnCreateOnly() throws Exception {
345346

346347
@Test
347348
@Transactional
348-
@Disabled("Time sensitive")
349+
@DisabledIfEnvironmentVariable(named = "bamboo_buildKey", matches = ".*?",
350+
disabledReason = "Timing is too short for CI")
349351
public void testExpireMessageGroupOnIdleOnly() throws Exception {
350352
String groupId = "X";
351353
Message<String> message = MessageBuilder.withPayload("foo").setCorrelationId(groupId).build();

0 commit comments

Comments
 (0)