Skip to content

Commit 515507a

Browse files
committed
Remove redundant --add-opens from Gradle config
* Mark `SftpSessionFactoryTests.sharedSessionConcurrentAccess()` and `StompServerIntegrationTests.testStompAdapters()` as `@RetryingTest(10)` since they are failing sporadically with a lost native operating system resources
1 parent 9881314 commit 515507a

File tree

3 files changed

+9
-31
lines changed

3 files changed

+9
-31
lines changed

build.gradle

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,6 @@ configure(javaProjects) { subproject ->
248248
options.addBooleanOption('Werror', true) // fail build on Javadoc warnings
249249
}
250250

251-
tasks.withType(JavaForkOptions) {
252-
jvmArgs '--add-opens', 'java.base/java.util=ALL-UNNAMED'
253-
}
254-
255251
eclipse {
256252
project {
257253
natures += 'org.springframework.ide.eclipse.core.springnature'
@@ -640,13 +636,7 @@ project('spring-integration-hazelcast') {
640636
}
641637

642638
tasks.withType(JavaForkOptions) {
643-
jvmArgs '--add-modules', 'java.se',
644-
'--add-exports', 'java.base/jdk.internal.ref=ALL-UNNAMED',
645-
'--add-opens', 'java.base/java.lang=ALL-UNNAMED',
646-
'--add-opens', 'java.base/sun.nio.ch=ALL-UNNAMED',
647-
'--add-opens', 'java.management/sun.management=ALL-UNNAMED',
648-
'--add-opens', 'jdk.management/com.sun.management.internal=ALL-UNNAMED',
649-
'-Dhazelcast.logging.type=log4j2'
639+
jvmArgs '-Dhazelcast.logging.type=log4j2'
650640
}
651641
}
652642

@@ -678,7 +668,8 @@ project('spring-integration-ip') {
678668
}
679669

680670
tasks.withType(JavaForkOptions) {
681-
jvmArgs '--add-opens', 'java.base/java.nio.channels.spi=ALL-UNNAMED'
671+
jvmArgs '--add-opens', 'java.base/java.nio.channels.spi=ALL-UNNAMED',
672+
'--add-opens', 'java.base/java.util=ALL-UNNAMED'
682673
}
683674
}
684675

@@ -823,10 +814,8 @@ project('spring-integration-scripting') {
823814
}
824815

825816
tasks.withType(JavaForkOptions) {
826-
jvmArgs '--add-opens', 'java.base/sun.nio.ch=ALL-UNNAMED',
827-
'--add-opens', 'java.base/java.io=ALL-UNNAMED',
828-
'--add-opens', 'java.base/java.lang=ALL-UNNAMED',
829-
'-Dpolyglot.engine.WarnInterpreterOnly=false'
817+
jvmArgs '--add-opens', 'java.base/java.lang=ALL-UNNAMED',
818+
'--enable-native-access=ALL-UNNAMED'
830819
}
831820
}
832821

@@ -869,12 +858,6 @@ project('spring-integration-stomp') {
869858
testRuntimeOnly 'org.springframework:spring-webmvc'
870859
testRuntimeOnly 'io.projectreactor.netty:reactor-netty-http'
871860
}
872-
873-
tasks.withType(JavaForkOptions) {
874-
jvmArgs '--add-opens', 'java.base/java.io=ALL-UNNAMED',
875-
'--add-opens', 'java.base/java.lang=ALL-UNNAMED',
876-
'--add-opens', 'java.rmi/sun.rmi.transport=ALL-UNNAMED'
877-
}
878861
}
879862

880863
project('spring-integration-stream') {
@@ -936,12 +919,6 @@ project('spring-integration-websocket') {
936919

937920
testRuntimeOnly 'tools.jackson.core:jackson-databind'
938921
}
939-
940-
tasks.withType(JavaForkOptions) {
941-
jvmArgs '--add-opens', 'java.base/java.io=ALL-UNNAMED',
942-
'--add-opens', 'java.base/java.lang=ALL-UNNAMED',
943-
'--add-opens', 'java.rmi/sun.rmi.transport=ALL-UNNAMED'
944-
}
945922
}
946923

947924
project('spring-integration-ws') {

spring-integration-sftp/src/test/java/org/springframework/integration/sftp/session/SftpSessionFactoryTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
import org.apache.sshd.sftp.client.impl.AbstractSftpClient;
4949
import org.apache.sshd.sftp.server.SftpSubsystemFactory;
5050
import org.junit.jupiter.api.Test;
51+
import org.junitpioneer.jupiter.RetryingTest;
5152

5253
import org.springframework.core.task.SimpleAsyncTaskExecutor;
5354

@@ -284,7 +285,7 @@ void clientSessionIsClosedOnSessionClose() throws Exception {
284285
}
285286
}
286287

287-
@Test
288+
@RetryingTest(10)
288289
void sharedSessionConcurrentAccess() throws Exception {
289290
try (SshServer server = SshServer.setUpDefaultServer()) {
290291
server.setPasswordAuthenticator((arg0, arg1, arg2) -> true);

spring-integration-stomp/src/test/java/org/springframework/integration/stomp/client/StompServerIntegrationTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
2424
import org.junit.jupiter.api.AfterAll;
2525
import org.junit.jupiter.api.BeforeAll;
26-
import org.junit.jupiter.api.Test;
26+
import org.junitpioneer.jupiter.RetryingTest;
2727

2828
import org.springframework.context.ApplicationEvent;
2929
import org.springframework.context.ApplicationListener;
@@ -103,7 +103,7 @@ public static void teardown() throws Exception {
103103
taskScheduler.destroy();
104104
}
105105

106-
@Test
106+
@RetryingTest(10)
107107
public void testStompAdapters() throws Exception {
108108
ConfigurableApplicationContext context1 = new AnnotationConfigApplicationContext(ContextConfiguration.class);
109109
ConfigurableApplicationContext context2 = new AnnotationConfigApplicationContext(ContextConfiguration.class);

0 commit comments

Comments
 (0)