From e2da2a27dee7ea3307985db3c126af13a58fca0b Mon Sep 17 00:00:00 2001 From: Michal Karm Babacek Date: Wed, 20 Mar 2024 16:38:02 +0100 Subject: [PATCH] Q 3.9+ extension renaming, OpenTelemetry whitelisting log --- .github/workflows/builder_image_tests.yml | 6 +- .github/workflows/local_tests.yml | 26 +- .../quarkus_3.9.x.patch | 13 + apps/quarkus-json/quarkus_3.9.x.patch | 42 +++ apps/quarkus-vertx/quarkus_3.9.x.patch | 287 ++++++++++++++++++ .../tests/integration/DebugSymbolsTest.java | 19 +- .../graalvm/tests/integration/JFRTest.java | 16 +- .../tests/integration/PerfCheckTest.java | 49 +-- .../tests/integration/utils/Commands.java | 9 +- .../integration/utils/WhitelistLogLines.java | 6 +- .../utils/versions/QuarkusVersion.java | 2 + 11 files changed, 445 insertions(+), 30 deletions(-) create mode 100644 apps/jfr-native-image-performance/quarkus_3.9.x.patch create mode 100644 apps/quarkus-json/quarkus_3.9.x.patch create mode 100644 apps/quarkus-vertx/quarkus_3.9.x.patch diff --git a/.github/workflows/builder_image_tests.yml b/.github/workflows/builder_image_tests.yml index 4536aa64..fc949377 100644 --- a/.github/workflows/builder_image_tests.yml +++ b/.github/workflows/builder_image_tests.yml @@ -35,12 +35,16 @@ jobs: mandrel-builder-image: '22.3-java17' - quarkus-version: '2.16.12.Final' mandrel-builder-image: '22.3-java17' - - quarkus-version: '3.2.9.Final' + - quarkus-version: '3.2.11.Final' mandrel-builder-image: 'jdk-17' - quarkus-version: '3.5.3' mandrel-builder-image: 'jdk-21' - quarkus-version: '3.6.0' mandrel-builder-image: 'jdk-21' + - quarkus-version: '3.8.3' + mandrel-builder-image: 'jdk-21' + - quarkus-version: '3.9.0.CR2' + mandrel-builder-image: 'jdk-21' steps: - uses: actions/checkout@v3 with: diff --git a/.github/workflows/local_tests.yml b/.github/workflows/local_tests.yml index e72d7acf..375ccd7f 100644 --- a/.github/workflows/local_tests.yml +++ b/.github/workflows/local_tests.yml @@ -70,12 +70,12 @@ jobs: os: 'ubuntu-20.04' timeout-minutes: 80 - - quarkus-version: '3.2.9.Final' + - quarkus-version: '3.2.11.Final' mandrel-version: '23.0.2.1-Final' java-version: '17' os: 'windows-2022' timeout-minutes: 80 - - quarkus-version: '3.2.9.Final' + - quarkus-version: '3.2.11.Final' mandrel-version: '23.0.2.1-Final' java-version: '17' os: 'ubuntu-20.04' @@ -102,6 +102,28 @@ jobs: java-version: '21' os: 'ubuntu-20.04' timeout-minutes: 130 + + - quarkus-version: '3.8.3' + mandrel-version: '23.1.2.0-Final' + java-version: '21' + os: 'windows-2022' + timeout-minutes: 80 + - quarkus-version: '3.8.3' + mandrel-version: '23.1.2.0-Final' + java-version: '21' + os: 'ubuntu-20.04' + timeout-minutes: 130 + + - quarkus-version: '3.9.0.CR2' + mandrel-version: '23.1.2.0-Final' + java-version: '21' + os: 'windows-2022' + timeout-minutes: 80 + - quarkus-version: '3.9.0.CR2' + mandrel-version: '23.1.2.0-Final' + java-version: '21' + os: 'ubuntu-20.04' + timeout-minutes: 130 steps: - uses: actions/checkout@v3 with: diff --git a/apps/jfr-native-image-performance/quarkus_3.9.x.patch b/apps/jfr-native-image-performance/quarkus_3.9.x.patch new file mode 100644 index 00000000..2d63c8a1 --- /dev/null +++ b/apps/jfr-native-image-performance/quarkus_3.9.x.patch @@ -0,0 +1,13 @@ +diff --git a/apps/jfr-native-image-performance/pom.xml b/apps/jfr-native-image-performance/pom.xml +index 771b835..60df02b 100644 +--- a/apps/jfr-native-image-performance/pom.xml ++++ b/apps/jfr-native-image-performance/pom.xml +@@ -33,7 +33,7 @@ + + + io.quarkus +- quarkus-resteasy-reactive ++ quarkus-rest + + + io.quarkus diff --git a/apps/quarkus-json/quarkus_3.9.x.patch b/apps/quarkus-json/quarkus_3.9.x.patch new file mode 100644 index 00000000..07c62052 --- /dev/null +++ b/apps/quarkus-json/quarkus_3.9.x.patch @@ -0,0 +1,42 @@ +diff --git a/apps/quarkus-json/pom.xml b/apps/quarkus-json/pom.xml +index 3d5fa5f..b1474e3 100644 +--- a/apps/quarkus-json/pom.xml ++++ b/apps/quarkus-json/pom.xml +@@ -32,11 +32,11 @@ + + + io.quarkus +- quarkus-resteasy-reactive-jackson ++ quarkus-rest-jackson + + + io.quarkus +- quarkus-resteasy-reactive ++ quarkus-rest + + + io.quarkus +diff --git a/apps/quarkus-json/src/main/java/org/acme/ExampleResource.java b/apps/quarkus-json/src/main/java/org/acme/ExampleResource.java +index dfb224d..a37b4a3 100644 +--- a/apps/quarkus-json/src/main/java/org/acme/ExampleResource.java ++++ b/apps/quarkus-json/src/main/java/org/acme/ExampleResource.java +@@ -1,12 +1,12 @@ + package org.acme; + +-import javax.ws.rs.Consumes; +-import javax.ws.rs.GET; +-import javax.ws.rs.POST; +-import javax.ws.rs.Path; +-import javax.ws.rs.Produces; +-import javax.ws.rs.core.MediaType; +-import javax.ws.rs.core.Response; ++import jakarta.ws.rs.Consumes; ++import jakarta.ws.rs.GET; ++import jakarta.ws.rs.POST; ++import jakarta.ws.rs.Path; ++import jakarta.ws.rs.Produces; ++import jakarta.ws.rs.core.MediaType; ++import jakarta.ws.rs.core.Response; + import java.io.ByteArrayOutputStream; + import java.math.BigInteger; + import java.security.MessageDigest; diff --git a/apps/quarkus-vertx/quarkus_3.9.x.patch b/apps/quarkus-vertx/quarkus_3.9.x.patch new file mode 100644 index 00000000..3cf88eab --- /dev/null +++ b/apps/quarkus-vertx/quarkus_3.9.x.patch @@ -0,0 +1,287 @@ +diff --git a/apps/quarkus-vertx/pom.xml b/apps/quarkus-vertx/pom.xml +index 7d47c9b..bc7da76 100644 +--- a/apps/quarkus-vertx/pom.xml ++++ b/apps/quarkus-vertx/pom.xml +@@ -36,11 +36,7 @@ + + + io.quarkus +- quarkus-resteasy +- +- +- io.quarkus +- quarkus-resteasy-mutiny ++ quarkus-rest + + + io.quarkus +@@ -56,11 +52,7 @@ + + + io.quarkus +- quarkus-resteasy-jsonb +- +- +- io.smallrye.reactive +- smallrye-mutiny-vertx-web-client ++ quarkus-rest-jsonb + + + +diff --git a/apps/quarkus-vertx/src/main/java/org/acme/vertx/FruitResource.java b/apps/quarkus-vertx/src/main/java/org/acme/vertx/FruitResource.java +index cf0796c..8cb6b0c 100644 +--- a/apps/quarkus-vertx/src/main/java/org/acme/vertx/FruitResource.java ++++ b/apps/quarkus-vertx/src/main/java/org/acme/vertx/FruitResource.java +@@ -18,22 +18,22 @@ package org.acme.vertx; + + import java.net.URI; + +-import javax.annotation.PostConstruct; +-import javax.inject.Inject; +-import javax.ws.rs.Consumes; +-import javax.ws.rs.DELETE; +-import javax.ws.rs.GET; +-import javax.ws.rs.POST; +-import javax.ws.rs.PUT; +-import javax.ws.rs.Path; +-import javax.ws.rs.Produces; +-import javax.ws.rs.core.MediaType; +-import javax.ws.rs.core.Response; +-import javax.ws.rs.core.Response.ResponseBuilder; +-import javax.ws.rs.core.Response.Status; ++import jakarta.annotation.PostConstruct; ++import jakarta.inject.Inject; ++import jakarta.ws.rs.Consumes; ++import jakarta.ws.rs.DELETE; ++import jakarta.ws.rs.GET; ++import jakarta.ws.rs.POST; ++import jakarta.ws.rs.PUT; ++import jakarta.ws.rs.Path; ++import jakarta.ws.rs.PathParam; ++import jakarta.ws.rs.Produces; ++import jakarta.ws.rs.core.MediaType; ++import jakarta.ws.rs.core.Response; ++import jakarta.ws.rs.core.Response.ResponseBuilder; ++import jakarta.ws.rs.core.Response.Status; + + import org.eclipse.microprofile.config.inject.ConfigProperty; +-import org.jboss.resteasy.annotations.jaxrs.PathParam; + + import io.smallrye.mutiny.Uni; + import io.vertx.mutiny.pgclient.PgPool; +@@ -43,29 +43,9 @@ import io.vertx.mutiny.pgclient.PgPool; + @Consumes(MediaType.APPLICATION_JSON) + public class FruitResource { + +- @Inject +- @ConfigProperty(name = "myapp.schema.create", defaultValue = "true") +- boolean schemaCreate; +- + @Inject + PgPool client; + +- @PostConstruct +- void config() { +- if (schemaCreate) { +- initdb(); +- } +- } +- +- private void initdb() { +- client.query("DROP TABLE IF EXISTS fruits").execute() +- .flatMap(r -> client.query("CREATE TABLE fruits (id SERIAL PRIMARY KEY, name TEXT NOT NULL)").execute()) +- .flatMap(r -> client.query("INSERT INTO fruits (name) VALUES ('Orange')").execute()) +- .flatMap(r -> client.query("INSERT INTO fruits (name) VALUES ('Pear')").execute()) +- .flatMap(r -> client.query("INSERT INTO fruits (name) VALUES ('Apple')").execute()) +- .await().indefinitely(); +- } +- + @GET + public Uni get() { + return Fruit.findAll(client) +@@ -75,7 +55,7 @@ public class FruitResource { + + @GET + @Path("{id}") +- public Uni getSingle(@PathParam Long id) { ++ public Uni getSingle(@PathParam(value = "id") Long id) { + return Fruit.findById(client, id) + .onItem().transform(fruit -> fruit != null ? Response.ok(fruit) : Response.status(Status.NOT_FOUND)) + .onItem().transform(ResponseBuilder::build); +@@ -90,7 +70,7 @@ public class FruitResource { + + @PUT + @Path("{id}") +- public Uni update(@PathParam Long id, Fruit fruit) { ++ public Uni update(@PathParam(value = "id") Long id, Fruit fruit) { + return fruit.update(client) + .onItem().transform(updated -> updated ? Status.OK : Status.NOT_FOUND) + .onItem().transform(status -> Response.status(status).build()); +@@ -98,7 +78,7 @@ public class FruitResource { + + @DELETE + @Path("{id}") +- public Uni delete(@PathParam Long id) { ++ public Uni delete(@PathParam(value = "id") Long id) { + return Fruit.delete(client, id) + .onItem().transform(deleted -> deleted ? Status.NO_CONTENT : Status.NOT_FOUND) + .onItem().transform(status -> Response.status(status).build()); +diff --git a/apps/quarkus-vertx/src/main/java/org/acme/vertx/GreetingResource.java b/apps/quarkus-vertx/src/main/java/org/acme/vertx/GreetingResource.java +index ac167a0..1b56c15 100644 +--- a/apps/quarkus-vertx/src/main/java/org/acme/vertx/GreetingResource.java ++++ b/apps/quarkus-vertx/src/main/java/org/acme/vertx/GreetingResource.java +@@ -15,19 +15,17 @@ + */ + package org.acme.vertx; + +-import static java.util.concurrent.TimeUnit.MILLISECONDS; +-import static java.util.concurrent.TimeUnit.NANOSECONDS; +- +-import javax.inject.Inject; +-import javax.ws.rs.GET; +-import javax.ws.rs.Path; +-import javax.ws.rs.Produces; +-import javax.ws.rs.core.MediaType; +- +-import org.jboss.resteasy.annotations.jaxrs.PathParam; +- + import io.smallrye.mutiny.Uni; + import io.vertx.core.Vertx; ++import jakarta.inject.Inject; ++import jakarta.ws.rs.GET; ++import jakarta.ws.rs.Path; ++import jakarta.ws.rs.PathParam; ++import jakarta.ws.rs.Produces; ++import jakarta.ws.rs.core.MediaType; ++ ++import static java.util.concurrent.TimeUnit.MILLISECONDS; ++import static java.util.concurrent.TimeUnit.NANOSECONDS; + + @Path("/hello") + public class GreetingResource { +@@ -38,7 +36,7 @@ public class GreetingResource { + @GET + @Produces(MediaType.TEXT_PLAIN) + @Path("{name}") +- public Uni greeting(@PathParam String name) { ++ public Uni greeting(@PathParam(value = "name") String name) { + return Uni.createFrom().emitter(emitter -> { + long start = System.nanoTime(); + vertx.setTimer(10, l -> { +diff --git a/apps/quarkus-vertx/src/main/java/org/acme/vertx/GreetingService.java b/apps/quarkus-vertx/src/main/java/org/acme/vertx/GreetingService.java +index 0cb587a..ba16e14 100644 +--- a/apps/quarkus-vertx/src/main/java/org/acme/vertx/GreetingService.java ++++ b/apps/quarkus-vertx/src/main/java/org/acme/vertx/GreetingService.java +@@ -15,7 +15,7 @@ + */ + package org.acme.vertx; + +-import javax.enterprise.context.ApplicationScoped; ++import jakarta.enterprise.context.ApplicationScoped; + + import io.quarkus.vertx.ConsumeEvent; + +diff --git a/apps/quarkus-vertx/src/main/java/org/acme/vertx/VertxJsonResource.java b/apps/quarkus-vertx/src/main/java/org/acme/vertx/VertxJsonResource.java +index cc9c525..4fc2fd4 100644 +--- a/apps/quarkus-vertx/src/main/java/org/acme/vertx/VertxJsonResource.java ++++ b/apps/quarkus-vertx/src/main/java/org/acme/vertx/VertxJsonResource.java +@@ -15,13 +15,12 @@ + */ + package org.acme.vertx; + +-import javax.ws.rs.GET; +-import javax.ws.rs.Path; +-import javax.ws.rs.Produces; +-import javax.ws.rs.core.MediaType; +- +-import org.jboss.resteasy.annotations.jaxrs.PathParam; ++import jakarta.ws.rs.GET; ++import jakarta.ws.rs.Path; ++import jakarta.ws.rs.Produces; ++import jakarta.ws.rs.core.MediaType; + ++import jakarta.ws.rs.PathParam; + import io.vertx.core.json.JsonArray; + import io.vertx.core.json.JsonObject; + +@@ -31,13 +30,13 @@ public class VertxJsonResource { + + @GET + @Path("{name}/object") +- public JsonObject jsonObject(@PathParam String name) { ++ public JsonObject jsonObject(@PathParam(value = "name") String name) { + return new JsonObject().put("Hello", name); + } + + @GET + @Path("{name}/array") +- public JsonArray jsonArray(@PathParam String name) { ++ public JsonArray jsonArray(@PathParam(value = "name") String name) { + return new JsonArray().add("Hello").add(name); + } + } +diff --git a/apps/quarkus-vertx/src/main/resources/application.properties b/apps/quarkus-vertx/src/main/resources/application.properties +index 33ee4a9..138bc8d 100644 +--- a/apps/quarkus-vertx/src/main/resources/application.properties ++++ b/apps/quarkus-vertx/src/main/resources/application.properties +@@ -5,4 +5,6 @@ quarkus.datasource.username=quarkus_test + quarkus.datasource.password=quarkus_test + quarkus.datasource.reactive.url=postgresql://localhost:5432/quarkus_test + +-myapp.schema.create=true +\ No newline at end of file ++myapp.schema.create=true ++# A very long time, we hang in there during debugging. ++quarkus.vertx.max-event-loop-execute-time=2M +diff --git a/apps/quarkus-vertx/src/main/java/org/acme/vertx/FruitApp.java b/apps/quarkus-vertx/src/main/java/org/acme/vertx/FruitApp.java +new file mode 100644 +index 0000000..b772382 +--- /dev/null ++++ b/apps/quarkus-vertx/src/main/java/org/acme/vertx/FruitApp.java +@@ -0,0 +1,45 @@ ++/* ++ * Copyright 2023 Red Hat, Inc. ++ * ++ * Red Hat licenses this file to you under the Apache License, version 2.0 ++ * (the "License"); you may not use this file except in compliance with the ++ * License. You may obtain a copy of the License at: ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT ++ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the ++ * License for the specific language governing permissions and limitations ++ * under the License. ++ */ ++ ++package org.acme.vertx; ++ ++import io.quarkus.runtime.Startup; ++import io.vertx.mutiny.pgclient.PgPool; ++import jakarta.enterprise.context.ApplicationScoped; ++import jakarta.inject.Inject; ++import org.eclipse.microprofile.config.inject.ConfigProperty; ++ ++@ApplicationScoped ++public class FruitApp { ++ ++ @Inject ++ @ConfigProperty(name = "myapp.schema.create", defaultValue = "true") ++ boolean schemaCreate; ++ ++ @Inject ++ PgPool client; ++ ++ @Startup ++ void initdb() { ++ if (schemaCreate) { ++ client.query("DROP TABLE IF EXISTS fruits").execute() ++ .flatMap(r -> client.query("CREATE TABLE fruits (id SERIAL PRIMARY KEY, name TEXT NOT NULL)").execute()) ++ .flatMap(r -> client.query("INSERT INTO fruits (name) VALUES ('Orange')").execute()) ++ .flatMap(r -> client.query("INSERT INTO fruits (name) VALUES ('Pear')").execute()) ++ .flatMap(r -> client.query("INSERT INTO fruits (name) VALUES ('Apple')").execute()).await().indefinitely(); ++ } ++ } ++} + diff --git a/testsuite/src/it/java/org/graalvm/tests/integration/DebugSymbolsTest.java b/testsuite/src/it/java/org/graalvm/tests/integration/DebugSymbolsTest.java index 1b30383b..e4ed380b 100644 --- a/testsuite/src/it/java/org/graalvm/tests/integration/DebugSymbolsTest.java +++ b/testsuite/src/it/java/org/graalvm/tests/integration/DebugSymbolsTest.java @@ -323,7 +323,7 @@ private boolean applySourcesPatch() { @Test @Tag("debugSymbolsQuarkus") @Tag("builder-image") - @DisabledOnOs({OS.WINDOWS}) + @DisabledOnOs({ OS.WINDOWS }) public void debugSymbolsQuarkusContainer(TestInfo testInfo) throws IOException, InterruptedException { final Apps app = Apps.DEBUG_QUARKUS_BUILDER_IMAGE_VERTX; LOGGER.info("Testing app: " + app); @@ -334,6 +334,8 @@ public void debugSymbolsQuarkusContainer(TestInfo testInfo) throws IOException, final String mn = testInfo.getTestMethod().get().getName(); final Pattern dbReady = Pattern.compile(".*ready to accept connections.*"); final Pattern appStarted = Pattern.compile(".*started.*"); + String patch = null; + try { // Cleanup cleanTarget(app); @@ -344,8 +346,15 @@ public void debugSymbolsQuarkusContainer(TestInfo testInfo) throws IOException, if (applySourcesPatch()) { runCommand(getRunCommand("git", "apply", "quarkus_sources.patch"), appDir); } - if (QUARKUS_VERSION.compareTo(QuarkusVersion.V_3_0_0) >= 0) { - runCommand(getRunCommand("git", "apply", "quarkus_3.x.patch"), appDir); + + if (QUARKUS_VERSION.compareTo(QuarkusVersion.V_3_9_0) >= 0) { + patch = "quarkus_3.9.x.patch"; + } else if (QUARKUS_VERSION.compareTo(QuarkusVersion.V_3_0_0) >= 0) { + patch = "quarkus_3.x.patch"; + } + + if (patch != null) { + runCommand(getRunCommand("git", "apply", patch), appDir); } // Build app and start db @@ -438,8 +447,8 @@ public void debugSymbolsQuarkusContainer(TestInfo testInfo) throws IOException, if (applySourcesPatch()) { runCommand(getRunCommand("git", "apply", "-R", "quarkus_sources.patch"), appDir); } - if (QUARKUS_VERSION.compareTo(QuarkusVersion.V_3_0_0) >= 0) { - runCommand(getRunCommand("git", "apply", "-R", "quarkus_3.x.patch"), appDir); + if (patch != null) { + runCommand(getRunCommand("git", "apply", "-R", patch), appDir); } } } diff --git a/testsuite/src/it/java/org/graalvm/tests/integration/JFRTest.java b/testsuite/src/it/java/org/graalvm/tests/integration/JFRTest.java index d58c052f..1b1fc7b7 100644 --- a/testsuite/src/it/java/org/graalvm/tests/integration/JFRTest.java +++ b/testsuite/src/it/java/org/graalvm/tests/integration/JFRTest.java @@ -27,6 +27,8 @@ import org.graalvm.tests.integration.utils.Logs; import org.graalvm.tests.integration.utils.WebpageTester; import org.graalvm.tests.integration.utils.versions.IfMandrelVersion; +import org.graalvm.tests.integration.utils.versions.IfQuarkusVersion; +import org.graalvm.tests.integration.utils.versions.QuarkusVersion; import org.graalvm.tests.integration.utils.versions.UsedVersion; import org.jboss.logging.Logger; import org.json.JSONObject; @@ -64,6 +66,7 @@ import static org.graalvm.tests.integration.utils.Commands.BUILDER_IMAGE; import static org.graalvm.tests.integration.utils.Commands.CONTAINER_RUNTIME; import static org.graalvm.tests.integration.utils.Commands.IS_THIS_WINDOWS; +import static org.graalvm.tests.integration.utils.Commands.QUARKUS_VERSION; import static org.graalvm.tests.integration.utils.Commands.builderRoutine; import static org.graalvm.tests.integration.utils.Commands.cleanTarget; import static org.graalvm.tests.integration.utils.Commands.cleanup; @@ -164,6 +167,7 @@ public void jfrSmokeTest(TestInfo testInfo) throws IOException, InterruptedExcep @Tag("jfr") @Tag("builder-image") @IfMandrelVersion(min = "23.0.0", inContainer = true) // Thread park event is introduced in 23.0 + @IfQuarkusVersion(min = "3.0") public void jfrPerfContainerTest(TestInfo testInfo) throws IOException, InterruptedException { jfrPerfTestRun(testInfo, true); } @@ -172,6 +176,7 @@ public void jfrPerfContainerTest(TestInfo testInfo) throws IOException, Interrup @Tag("jfr-perf") @Tag("jfr") @IfMandrelVersion(min = "23.0.0") // Thread park event is introduced in 23.0 + @IfQuarkusVersion(min = "3.0") public void jfrPerfTest(TestInfo testInfo) throws IOException, InterruptedException { jfrPerfTestRun(testInfo, false); } @@ -187,6 +192,7 @@ public void jfrPerfTestRun(TestInfo testInfo, boolean inContainer) throws IOExce final String mn = testInfo.getTestMethod().get().getName(); final Path measurementsLog = Paths.get(Logs.getLogsDir(cn, mn).toString(), "measurements.csv"); final Path jfrPerfJfc = Paths.get(appDir.getAbsolutePath(), "jfr-perf.jfc"); + String patch = null; try { // Cleanup @@ -202,11 +208,16 @@ public void jfrPerfTestRun(TestInfo testInfo, boolean inContainer) throws IOExce generateJFRConfigurationFile(inContainer, jfrPerfJfc, processLog); - Map switches = null; if (UsedVersion.getVersion(inContainer).compareTo(Version.create(23, 1, 0)) >= 0) { switches = Map.of("-H:+SignalHandlerBasedExecutionSampler", "-H:+UnlockExperimentalVMOptions,-H:+SignalHandlerBasedExecutionSampler,-H:-UnlockExperimentalVMOptions"); } + + if (QUARKUS_VERSION.compareTo(QuarkusVersion.V_3_9_0) >= 0) { + patch = "quarkus_3.9.x.patch"; + runCommand(getRunCommand("git", "apply", patch), appDir); + } + // Container build requires an additional step: docker build... builderRoutine(inContainer ? 2 : 1, appJfr, report, cn, mn, appDir, processLog, null, switches); builderRoutine(inContainer ? 2 : 1, appNoJfr, report, cn, mn, appDir, processLog, null, switches); @@ -235,6 +246,9 @@ public void jfrPerfTestRun(TestInfo testInfo, boolean inContainer) throws IOExce removeContainers(ContainerNames.JFR_PERFORMANCE_BUILDER_IMAGE.name, ContainerNames.JFR_PLAINTEXT_BUILDER_IMAGE.name); } enableTurbo(); + if (patch != null) { + runCommand(getRunCommand("git", "apply", "-R", patch), appDir); + } } } diff --git a/testsuite/src/it/java/org/graalvm/tests/integration/PerfCheckTest.java b/testsuite/src/it/java/org/graalvm/tests/integration/PerfCheckTest.java index 4a0b09d5..9d31757f 100644 --- a/testsuite/src/it/java/org/graalvm/tests/integration/PerfCheckTest.java +++ b/testsuite/src/it/java/org/graalvm/tests/integration/PerfCheckTest.java @@ -31,7 +31,6 @@ import org.graalvm.tests.integration.utils.versions.UsedVersion; import org.jboss.logging.Logger; import org.jboss.resteasy.spi.HttpResponseCodes; -import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInfo; @@ -133,14 +132,22 @@ public void testQuarkusJSONParseOnce(TestInfo testInfo) throws IOException, Inte final List> reports = new ArrayList<>(3); // Test data tmp storage final File json = Path.of(appDir.getAbsolutePath(), "logs", "record.json").toFile(); + String patch = null; + try { // Cleanup cleanTarget(app); Files.createDirectories(Paths.get(appDir.getAbsolutePath(), "logs")); assertTrue(app.buildAndRunCmds.cmds.length > 1); - if (QUARKUS_VERSION.compareTo(QuarkusVersion.V_3_0_0) >= 0) { - runCommand(getRunCommand("git", "apply", "quarkus_3.x.patch"), appDir); + if (QUARKUS_VERSION.compareTo(QuarkusVersion.V_3_9_0) >= 0) { + patch = "quarkus_3.9.x.patch"; + } else if (QUARKUS_VERSION.compareTo(QuarkusVersion.V_3_0_0) >= 0) { + patch = "quarkus_3.x.patch"; + } + + if (patch != null) { + runCommand(getRunCommand("git", "apply", patch), appDir); } // Build executables @@ -158,10 +165,10 @@ public void testQuarkusJSONParseOnce(TestInfo testInfo) throws IOException, Inte report.put("timeToFirstOKRequestMs", String.valueOf(timeToFirstOKRequestMs)); // Test web pages try (final ReadableByteChannel readableByteChannel = Channels.newChannel(new URL(app.urlContent.urlContent[1][0]).openStream()); - final FileOutputStream fileOutputStream = new FileOutputStream(json)) { + final FileOutputStream fileOutputStream = new FileOutputStream(json)) { fileOutputStream.getChannel().transferFrom(readableByteChannel, 0, Long.MAX_VALUE); } - final String[] headers = new String[]{ + final String[] headers = new String[] { "Content-Type", "application/json", "Accept", "text/plain" }; @@ -196,7 +203,7 @@ public void testQuarkusJSONParseOnce(TestInfo testInfo) throws IOException, Inte report.put("branches", String.valueOf(pr.branches)); report.put("branchMisses", String.valueOf(pr.branchMisses)); report.put("secondsTimeElapsed", String.valueOf(pr.secondsTimeElapsed)); - Assertions.assertTrue(waitForTcpClosed("localhost", parsePort(app.urlContent.urlContent[0][0]), 60), + assertTrue(waitForTcpClosed("localhost", parsePort(app.urlContent.urlContent[0][0]), 60), "Main port is still open"); final Commands.SerialGCLog l; if (!statsFor.contains("-jar")) { @@ -231,7 +238,7 @@ public void testQuarkusJSONParseOnce(TestInfo testInfo) throws IOException, Inte } } LOGGER.info("Gonna wait for ports closed..."); - Assertions.assertTrue(waitForTcpClosed("localhost", parsePort(app.urlContent.urlContent[0][0]), 60), + assertTrue(waitForTcpClosed("localhost", parsePort(app.urlContent.urlContent[0][0]), 60), "Main port is still open"); Logs.checkLog(cn, mn, app, processLog); } finally { @@ -245,8 +252,8 @@ public void testQuarkusJSONParseOnce(TestInfo testInfo) throws IOException, Inte "quarkus-json_+ParseOnce-native-image-source-jar", "quarkus-json_plus-ParseOnce.json").toFile()); Logs.archiveLog(cn, mn, processLog); cleanTarget(app); - if (QUARKUS_VERSION.compareTo(QuarkusVersion.V_3_0_0) >= 0) { - runCommand(getRunCommand("git", "apply", "-R", "quarkus_3.x.patch"), appDir); + if (patch != null) { + runCommand(getRunCommand("git", "apply", "-R", patch), appDir); } } } @@ -264,14 +271,22 @@ public void testQuarkusJSON(TestInfo testInfo) throws IOException, InterruptedEx final List> reports = new ArrayList<>(2); // Test data tmp storage final File json = Path.of(appDir.getAbsolutePath(), "logs", "record.json").toFile(); + String patch = null; + try { // Cleanup cleanTarget(app); Files.createDirectories(Paths.get(appDir.getAbsolutePath(), "logs")); assertTrue(app.buildAndRunCmds.cmds.length > 1); - if (QUARKUS_VERSION.compareTo(QuarkusVersion.V_3_0_0) >= 0) { - runCommand(getRunCommand("git", "apply", "quarkus_3.x.patch"), appDir); + if (QUARKUS_VERSION.compareTo(QuarkusVersion.V_3_9_0) >= 0) { + patch = "quarkus_3.9.x.patch"; + } else if (QUARKUS_VERSION.compareTo(QuarkusVersion.V_3_0_0) >= 0) { + patch = "quarkus_3.x.patch"; + } + + if (patch != null) { + runCommand(getRunCommand("git", "apply", patch), appDir); } // Build executables @@ -326,7 +341,7 @@ public void testQuarkusJSON(TestInfo testInfo) throws IOException, InterruptedEx report.put("branches", String.valueOf(pr.branches)); report.put("branchMisses", String.valueOf(pr.branchMisses)); report.put("secondsTimeElapsed", String.valueOf(pr.secondsTimeElapsed)); - Assertions.assertTrue(waitForTcpClosed("localhost", parsePort(app.urlContent.urlContent[0][0]), 60), + assertTrue(waitForTcpClosed("localhost", parsePort(app.urlContent.urlContent[0][0]), 60), "Main port is still open"); final Commands.SerialGCLog l; if (!statsFor.contains("-jar")) { @@ -360,7 +375,7 @@ public void testQuarkusJSON(TestInfo testInfo) throws IOException, InterruptedEx } } LOGGER.info("Gonna wait for ports closed..."); - Assertions.assertTrue(waitForTcpClosed("localhost", parsePort(app.urlContent.urlContent[0][0]), 60), + assertTrue(waitForTcpClosed("localhost", parsePort(app.urlContent.urlContent[0][0]), 60), "Main port is still open"); Logs.checkLog(cn, mn, app, processLog); } finally { @@ -372,8 +387,8 @@ public void testQuarkusJSON(TestInfo testInfo) throws IOException, InterruptedEx "quarkus-json-native-image-source-jar", "quarkus-json.json").toFile()); Logs.archiveLog(cn, mn, processLog); cleanTarget(app); - if (QUARKUS_VERSION.compareTo(QuarkusVersion.V_3_0_0) >= 0) { - runCommand(getRunCommand("git", "apply", "-R", "quarkus_3.x.patch"), appDir); + if (patch != null) { + runCommand(getRunCommand("git", "apply", "-R", patch), appDir); } } } @@ -453,7 +468,7 @@ public void testQuarkusFullMicroProfile(TestInfo testInfo) throws IOException, I report.put("branches", String.valueOf(pr.branches)); report.put("branchMisses", String.valueOf(pr.branchMisses)); report.put("secondsTimeElapsed", String.valueOf(pr.secondsTimeElapsed)); - Assertions.assertTrue(waitForTcpClosed("localhost", parsePort(app.urlContent.urlContent[0][0]), 60), + assertTrue(waitForTcpClosed("localhost", parsePort(app.urlContent.urlContent[0][0]), 60), "Main port is still open"); final Commands.SerialGCLog l; if (!statsFor.contains("-jar")) { @@ -486,7 +501,7 @@ public void testQuarkusFullMicroProfile(TestInfo testInfo) throws IOException, I } } LOGGER.info("Gonna wait for ports closed..."); - Assertions.assertTrue(waitForTcpClosed("localhost", parsePort(app.urlContent.urlContent[0][0]), 60), + assertTrue(waitForTcpClosed("localhost", parsePort(app.urlContent.urlContent[0][0]), 60), "Main port is still open"); Logs.checkLog(cn, mn, app, processLog); } finally { diff --git a/testsuite/src/it/java/org/graalvm/tests/integration/utils/Commands.java b/testsuite/src/it/java/org/graalvm/tests/integration/utils/Commands.java index 75716024..cb6c4f92 100644 --- a/testsuite/src/it/java/org/graalvm/tests/integration/utils/Commands.java +++ b/testsuite/src/it/java/org/graalvm/tests/integration/utils/Commands.java @@ -1165,15 +1165,18 @@ public static void replaceInSmallTextFile(Pattern search, String replace, Path f /** * Finds the first matching executable in a given dir, - * *does not dive into the tree*, is not recursive... + * does not dive into the tree, is not recursive... * * @param dir * @param regexp * @return null or the found file */ public static File findExecutable(Path dir, Pattern regexp) { - if (dir == null || Files.notExists(dir) || regexp == null) { - throw new IllegalArgumentException("Path to " + dir + "must exist and regexp must nut be null."); + if (regexp == null) { + throw new IllegalArgumentException("Regexp must not be null."); + } + if (dir == null || Files.notExists(dir)) { + throw new IllegalArgumentException("Path to " + dir + " must exist."); } final File[] f = dir.toFile().listFiles(pathname -> { if (pathname.isFile() && Files.isExecutable(pathname.toPath())) { diff --git a/testsuite/src/it/java/org/graalvm/tests/integration/utils/WhitelistLogLines.java b/testsuite/src/it/java/org/graalvm/tests/integration/utils/WhitelistLogLines.java index 9c4fb189..688566b2 100755 --- a/testsuite/src/it/java/org/graalvm/tests/integration/utils/WhitelistLogLines.java +++ b/testsuite/src/it/java/org/graalvm/tests/integration/utils/WhitelistLogLines.java @@ -51,6 +51,8 @@ public Pattern[] get(boolean inContainer) { Pattern.compile(".*system modules path not set in conjunction with -source .*"), // It's accompanied by a list of all warnings, so this particular one can be white-listed globally Pattern.compile(".*Warning: Please re-evaluate whether any experimental option is required, and either remove or unlock it\\..*"), + // Quarkus main 2024-03-21 deprecates this maven plugin directive + Pattern.compile(".*Configuration property 'quarkus.package.type' has been deprecated.*"), }; } }, @@ -122,7 +124,9 @@ public Pattern[] get(boolean inContainer) { // netty 4 which doesn't have the relevant native config in the lib. See https://github.com/netty/netty/pull/13596 Pattern.compile(".*Warning: The option '-H:ReflectionConfigurationResources=META-INF/native-image/io\\.netty/netty-transport/reflection-config\\.json' is experimental and must be enabled via.*"), // We don't run any OpenTracing collector point for simplicity, hence the exception. Q 3.6.0+ specific. - Pattern.compile(".*Failed to export spans. The request could not be executed. Full error message: Connection refused:.*") + Pattern.compile(".*Failed to export spans. The request could not be executed. Full error message: Connection refused:.*"), + // Quarkus 3.8.3+ HotSpot (JVM) specific and specific to OpenTelemetry trying to connect to non-existing host + Pattern.compile(".*io.quarkus.security.runtime.SecurityIdentity.*"), }; } }, diff --git a/testsuite/src/it/java/org/graalvm/tests/integration/utils/versions/QuarkusVersion.java b/testsuite/src/it/java/org/graalvm/tests/integration/utils/versions/QuarkusVersion.java index f6b2408f..40aff903 100644 --- a/testsuite/src/it/java/org/graalvm/tests/integration/utils/versions/QuarkusVersion.java +++ b/testsuite/src/it/java/org/graalvm/tests/integration/utils/versions/QuarkusVersion.java @@ -30,6 +30,8 @@ public class QuarkusVersion implements Comparable { public static final QuarkusVersion V_3_0_0 = new QuarkusVersion("3.0.0"); public static final QuarkusVersion V_3_6_0 = new QuarkusVersion("3.6.0"); public static final QuarkusVersion V_3_7_0 = new QuarkusVersion("3.7.0"); + public static final QuarkusVersion V_3_9_0 = new QuarkusVersion("3.9.0"); + private final String version; private final int major; private final int minor;