From edd12f2ca385b8dcb3b56d8c483e87708c783a7b Mon Sep 17 00:00:00 2001 From: Tommy Ludwig <8924140+shakuzen@users.noreply.github.com> Date: Fri, 15 Nov 2024 16:41:31 +0900 Subject: [PATCH 1/2] Upgrade to Netty 4.1.115 Closes gh-5660 --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 7183814502..7829e7edd6 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -60,7 +60,7 @@ maven-resolver = "1.9.22" mockito4 = "4.11.0" mockito5 = "5.7.0" mongo = "4.11.4" -netty = "4.1.114.Final" +netty = "4.1.115.Final" newrelic-api = "5.14.0" okhttp = "4.11.0" postgre = "42.6.2" From bd90d13e2708638594525d797b92156e1a5adfd8 Mon Sep 17 00:00:00 2001 From: Tommy Ludwig <8924140+shakuzen@users.noreply.github.com> Date: Fri, 15 Nov 2024 16:58:25 +0900 Subject: [PATCH 2/2] Use fixed version of Prometheus image for IT The dynamic version caused build failures even though nothing was changed due to a new major version of Prometheus released. This uses a fixed version to allow the build to pass and avoid such issues with non-reproducible builds. Resolves gh-5665 --- .../micrometer-registry-prometheus/build.gradle | 4 ++++ .../PrometheusMeterRegistryIntegrationTest.java | 12 +++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/implementations/micrometer-registry-prometheus/build.gradle b/implementations/micrometer-registry-prometheus/build.gradle index cad117908b..c91ceb20a9 100644 --- a/implementations/micrometer-registry-prometheus/build.gradle +++ b/implementations/micrometer-registry-prometheus/build.gradle @@ -18,3 +18,7 @@ dependencies { testImplementation 'org.testcontainers:junit-jupiter' testImplementation 'org.awaitility:awaitility' } + +dockerTest { + systemProperty 'prometheus.version', 'v2.55.1' +} diff --git a/implementations/micrometer-registry-prometheus/src/test/java/io/micrometer/prometheusmetrics/PrometheusMeterRegistryIntegrationTest.java b/implementations/micrometer-registry-prometheus/src/test/java/io/micrometer/prometheusmetrics/PrometheusMeterRegistryIntegrationTest.java index 6614b12578..b670e166ef 100644 --- a/implementations/micrometer-registry-prometheus/src/test/java/io/micrometer/prometheusmetrics/PrometheusMeterRegistryIntegrationTest.java +++ b/implementations/micrometer-registry-prometheus/src/test/java/io/micrometer/prometheusmetrics/PrometheusMeterRegistryIntegrationTest.java @@ -57,7 +57,8 @@ class PrometheusMeterRegistryIntegrationTest { @Container - static GenericContainer prometheus = new GenericContainer<>(DockerImageName.parse("prom/prometheus:latest")) + static GenericContainer prometheus = new GenericContainer<>( + DockerImageName.parse("prom/prometheus:" + getPrometheusImageVersion())) .withCommand("--config.file=/etc/prometheus/prometheus.yml") .withClasspathResourceMapping("prometheus.yml", "/etc/prometheus/prometheus.yml", READ_ONLY) .waitingFor(Wait.forLogMessage(".*Server is ready to receive web requests.*", 1)) @@ -72,6 +73,15 @@ class PrometheusMeterRegistryIntegrationTest { @Nullable private HttpServer prometheusTextServer; + private static String getPrometheusImageVersion() { + String version = System.getProperty("prometheus.version"); + if (version == null) { + throw new IllegalStateException( + "System property 'prometheus.version' is not set. This should be set in the build configuration for running from the command line. If you are running PrometheusMeterRegistryIntegrationTest from an IDE, set the system property to the desired prom/prometheus image version."); + } + return version; + } + @BeforeEach void setUp() { org.testcontainers.Testcontainers.exposeHostPorts(12345, 12346);