From 12633a87ada8dacde80e8630108d1b2d336ffab0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Apr 2025 08:03:46 +0000 Subject: [PATCH 1/3] build: bump version.testcontainers from 1.20.3 to 1.20.6 Bumps `version.testcontainers` from 1.20.3 to 1.20.6. Updates `org.testcontainers:testcontainers-bom` from 1.20.3 to 1.20.6 - [Release notes](https://github.com/testcontainers/testcontainers-java/releases) - [Changelog](https://github.com/testcontainers/testcontainers-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/testcontainers/testcontainers-java/compare/1.20.3...1.20.6) Updates `org.testcontainers:testcontainers` from 1.20.3 to 1.20.6 - [Release notes](https://github.com/testcontainers/testcontainers-java/releases) - [Changelog](https://github.com/testcontainers/testcontainers-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/testcontainers/testcontainers-java/compare/1.20.3...1.20.6) --- updated-dependencies: - dependency-name: org.testcontainers:testcontainers-bom dependency-version: 1.20.6 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.testcontainers:testcontainers dependency-version: 1.20.6 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8146a29bd6..7bc88657e7 100644 --- a/pom.xml +++ b/pom.xml @@ -139,7 +139,7 @@ 1.17 - 1.20.3 + 1.21.0 2.38.0 From 234799677953d377aa10c97add79b747e251b696 Mon Sep 17 00:00:00 2001 From: Sylvain Juge <763082+SylvainJuge@users.noreply.github.com> Date: Fri, 2 May 2025 14:36:43 +0200 Subject: [PATCH 2/3] workaround for testcontainers issue --- .../src/test/java/co/elastic/apm/test/AgentSetupIT.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/integration-tests/main-app-test/src/test/java/co/elastic/apm/test/AgentSetupIT.java b/integration-tests/main-app-test/src/test/java/co/elastic/apm/test/AgentSetupIT.java index fac320dffe..34ee0260d5 100644 --- a/integration-tests/main-app-test/src/test/java/co/elastic/apm/test/AgentSetupIT.java +++ b/integration-tests/main-app-test/src/test/java/co/elastic/apm/test/AgentSetupIT.java @@ -66,9 +66,11 @@ void testSecurityManagerWarning() { try (AgentTestContainer.JarApp app = testAppWithJavaAgent("openjdk:17", AgentFileAccessor.Variant.STANDARD)) { app.withSecurityManager(null) - .waitingFor(Wait.forLogMessage(expectedMsg, 1)) + // using a dummy command since testcontainers 1.21.0 as waiting on stderr msg is not working anymore + // when the container fails to start. Likely related to https://github.com/testcontainers/testcontainers-java/issues/9956 + .waitingFor(Wait.forSuccessfulCommand("bash --version")) // we expect startup to fail fast as JVM should not even properly start - .withStartupTimeout(Duration.ofSeconds(1)); + .withStartupTimeout(Duration.ofSeconds(3)); app.start(); From 8bdec28070f214f556e45270fbdbf178f505a982 Mon Sep 17 00:00:00 2001 From: Sylvain Juge <763082+SylvainJuge@users.noreply.github.com> Date: Fri, 2 May 2025 16:03:47 +0200 Subject: [PATCH 3/3] make test more reliable --- .../src/test/java/co/elastic/apm/test/AgentSetupIT.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/integration-tests/main-app-test/src/test/java/co/elastic/apm/test/AgentSetupIT.java b/integration-tests/main-app-test/src/test/java/co/elastic/apm/test/AgentSetupIT.java index 34ee0260d5..32e6c05903 100644 --- a/integration-tests/main-app-test/src/test/java/co/elastic/apm/test/AgentSetupIT.java +++ b/integration-tests/main-app-test/src/test/java/co/elastic/apm/test/AgentSetupIT.java @@ -68,7 +68,7 @@ void testSecurityManagerWarning() { app.withSecurityManager(null) // using a dummy command since testcontainers 1.21.0 as waiting on stderr msg is not working anymore // when the container fails to start. Likely related to https://github.com/testcontainers/testcontainers-java/issues/9956 - .waitingFor(Wait.forSuccessfulCommand("bash --version")) + .waitingFor(Wait.forLogMessage(".*processing of -javaagent failed, processJavaStart failed.*", 1)) // we expect startup to fail fast as JVM should not even properly start .withStartupTimeout(Duration.ofSeconds(3)); @@ -85,7 +85,7 @@ void testSecurityManagerWithPolicy(@TempDir Path temp) throws IOException { // use a 'grant all' policy for now Files.write(tempPolicy, Arrays.asList( - "grant codeBase \"file:///tmp/elastic-apm-agent.jar\" {", + "grant codeBase \"file:///agent.jar\" {", " permission java.security.AllPermission;", "};"), StandardOpenOption.CREATE );