From 36e728c822f08e47fa6431db6bbccd269fd30652 Mon Sep 17 00:00:00 2001 From: Eugene Orlovsky Date: Sun, 24 Nov 2024 17:57:41 +0100 Subject: [PATCH 1/6] Update settings.gradle --- settings.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/settings.gradle b/settings.gradle index 37cb638087..e64c81d2a3 100644 --- a/settings.gradle +++ b/settings.gradle @@ -42,3 +42,4 @@ include "smoke-tests" include "testing:agent-for-testing" include "test-utils" include "utils" + From e5f671053f2b6488d36e88b8399ae03e3da53baf Mon Sep 17 00:00:00 2001 From: Eugene Orlovsky Date: Mon, 25 Nov 2024 09:44:00 +0100 Subject: [PATCH 2/6] test: netty version exclude --- .../main/resources/tested_versions/netty-4.1 | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/instrumentation/netty/netty-4.1/javaagent/src/main/resources/tested_versions/netty-4.1 b/instrumentation/netty/netty-4.1/javaagent/src/main/resources/tested_versions/netty-4.1 index d333cb373d..cb46403123 100644 --- a/instrumentation/netty/netty-4.1/javaagent/src/main/resources/tested_versions/netty-4.1 +++ b/instrumentation/netty/netty-4.1/javaagent/src/main/resources/tested_versions/netty-4.1 @@ -7,9 +7,9 @@ 4.1.6.Final 4.1.7.Final !4.1.8.Final -4.1.9.Final +!4.1.9.Final !4.1.10.Final -4.1.11.Final +!4.1.11.Final 4.1.12.Final 4.1.13.Final 4.1.14.Final @@ -32,8 +32,8 @@ 4.1.31.Final 4.1.32.Final !4.1.33.Final -4.1.34.Final -4.1.35.Final +!4.1.34.Final +!4.1.35.Final 4.1.36.Final 4.1.37.Final 4.1.38.Final @@ -90,7 +90,7 @@ 4.1.89.Final 4.1.90.Final !4.1.91.Final -4.1.92.Final +!4.1.92.Final 4.1.93.Final 4.1.94.Final 4.1.95.Final @@ -114,9 +114,9 @@ 4.1.113.Final 4.1.114.Final 4.1.115.Final -4.2.0.Alpha1 -4.2.0.Alpha2 +!4.2.0.Alpha1 +!4.2.0.Alpha2 !4.2.0.Alpha3 -4.2.0.Alpha4 -4.2.0.Alpha5 -4.2.0.Beta1 +!4.2.0.Alpha4 +!4.2.0.Alpha5 +!4.2.0.Beta1 From 054f42c8fbe11f571fa91991f2af9cdf13975c44 Mon Sep 17 00:00:00 2001 From: Eugene Orlovsky Date: Mon, 25 Nov 2024 10:13:40 +0100 Subject: [PATCH 3/6] test: netty test flaky --- .../main/resources/tested_versions/netty-4.1 | 20 +++++++++---------- .../netty/v4_1/NettyServer.java | 4 ++++ .../instrumentation/netty/v4_1/NettyTest.java | 5 ++++- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/instrumentation/netty/netty-4.1/javaagent/src/main/resources/tested_versions/netty-4.1 b/instrumentation/netty/netty-4.1/javaagent/src/main/resources/tested_versions/netty-4.1 index cb46403123..d333cb373d 100644 --- a/instrumentation/netty/netty-4.1/javaagent/src/main/resources/tested_versions/netty-4.1 +++ b/instrumentation/netty/netty-4.1/javaagent/src/main/resources/tested_versions/netty-4.1 @@ -7,9 +7,9 @@ 4.1.6.Final 4.1.7.Final !4.1.8.Final -!4.1.9.Final +4.1.9.Final !4.1.10.Final -!4.1.11.Final +4.1.11.Final 4.1.12.Final 4.1.13.Final 4.1.14.Final @@ -32,8 +32,8 @@ 4.1.31.Final 4.1.32.Final !4.1.33.Final -!4.1.34.Final -!4.1.35.Final +4.1.34.Final +4.1.35.Final 4.1.36.Final 4.1.37.Final 4.1.38.Final @@ -90,7 +90,7 @@ 4.1.89.Final 4.1.90.Final !4.1.91.Final -!4.1.92.Final +4.1.92.Final 4.1.93.Final 4.1.94.Final 4.1.95.Final @@ -114,9 +114,9 @@ 4.1.113.Final 4.1.114.Final 4.1.115.Final -!4.2.0.Alpha1 -!4.2.0.Alpha2 +4.2.0.Alpha1 +4.2.0.Alpha2 !4.2.0.Alpha3 -!4.2.0.Alpha4 -!4.2.0.Alpha5 -!4.2.0.Beta1 +4.2.0.Alpha4 +4.2.0.Alpha5 +4.2.0.Beta1 diff --git a/instrumentation/netty/netty-4.1/javaagent/src/test/java/io/lumigo/javaagent/instrumentation/netty/v4_1/NettyServer.java b/instrumentation/netty/netty-4.1/javaagent/src/test/java/io/lumigo/javaagent/instrumentation/netty/v4_1/NettyServer.java index dc89fee048..8e7f1620c3 100644 --- a/instrumentation/netty/netty-4.1/javaagent/src/test/java/io/lumigo/javaagent/instrumentation/netty/v4_1/NettyServer.java +++ b/instrumentation/netty/netty-4.1/javaagent/src/test/java/io/lumigo/javaagent/instrumentation/netty/v4_1/NettyServer.java @@ -65,4 +65,8 @@ public void stop() { bossGroup.shutdownGracefully(); workerGroup.shutdownGracefully(); } + + public boolean isReady() { + return channelFuture != null && channelFuture.channel().isActive(); + } } diff --git a/instrumentation/netty/netty-4.1/javaagent/src/test/java/io/lumigo/javaagent/instrumentation/netty/v4_1/NettyTest.java b/instrumentation/netty/netty-4.1/javaagent/src/test/java/io/lumigo/javaagent/instrumentation/netty/v4_1/NettyTest.java index bc42f04a26..55ae4f21c6 100644 --- a/instrumentation/netty/netty-4.1/javaagent/src/test/java/io/lumigo/javaagent/instrumentation/netty/v4_1/NettyTest.java +++ b/instrumentation/netty/netty-4.1/javaagent/src/test/java/io/lumigo/javaagent/instrumentation/netty/v4_1/NettyTest.java @@ -17,6 +17,7 @@ */ package io.lumigo.javaagent.instrumentation.netty.v4_1; +import static org.awaitility.Awaitility.await; import static org.junit.jupiter.api.Assertions.assertEquals; import io.netty.handler.codec.http.HttpResponseStatus; @@ -27,6 +28,7 @@ import io.opentelemetry.sdk.testing.assertj.TracesAssert; import io.opentelemetry.semconv.SemanticAttributes; import java.nio.charset.StandardCharsets; +import java.util.concurrent.TimeUnit; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -45,7 +47,8 @@ public static void setup() throws InterruptedException { serverPort = PortUtils.findOpenPort(); server = new NettyServer(serverPort); server.start(); - Thread.sleep(1000); // Wait briefly to ensure the server is fully initialized + await().atMost(5, TimeUnit.SECONDS).until(() -> server.isReady()); + // Thread.sleep(1000); // Wait briefly to ensure the server is fully initialized } @Test From 6175600ae94eda055ac024549e7f4a6f6591a7bc Mon Sep 17 00:00:00 2001 From: Eugene Orlovsky Date: Mon, 25 Nov 2024 17:15:09 +0100 Subject: [PATCH 4/6] test: netty test flaky --- .../lumigo/javaagent/instrumentation/netty/v4_1/NettyTest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/instrumentation/netty/netty-4.1/javaagent/src/test/java/io/lumigo/javaagent/instrumentation/netty/v4_1/NettyTest.java b/instrumentation/netty/netty-4.1/javaagent/src/test/java/io/lumigo/javaagent/instrumentation/netty/v4_1/NettyTest.java index 55ae4f21c6..a48acebdbc 100644 --- a/instrumentation/netty/netty-4.1/javaagent/src/test/java/io/lumigo/javaagent/instrumentation/netty/v4_1/NettyTest.java +++ b/instrumentation/netty/netty-4.1/javaagent/src/test/java/io/lumigo/javaagent/instrumentation/netty/v4_1/NettyTest.java @@ -61,6 +61,7 @@ public void testGetResponse() throws InterruptedException { String responseBody = response.content().toString(StandardCharsets.UTF_8); assertEquals("Hello, World!", responseBody); + Thread.sleep(1000); // Wait briefly to ensure the spans are captured TracesAssert.assertThat(instrumentation.waitForTraces(1)) .hasSize(1) .hasTracesSatisfyingExactly( From b858e6720c769409b1e63964b4e8fa62be3c9a4b Mon Sep 17 00:00:00 2001 From: Eugene Orlovsky Date: Mon, 25 Nov 2024 17:40:14 +0100 Subject: [PATCH 5/6] test: netty test flaky --- .../lumigo/javaagent/instrumentation/netty/v4_1/NettyTest.java | 1 - 1 file changed, 1 deletion(-) diff --git a/instrumentation/netty/netty-4.1/javaagent/src/test/java/io/lumigo/javaagent/instrumentation/netty/v4_1/NettyTest.java b/instrumentation/netty/netty-4.1/javaagent/src/test/java/io/lumigo/javaagent/instrumentation/netty/v4_1/NettyTest.java index a48acebdbc..54599290d8 100644 --- a/instrumentation/netty/netty-4.1/javaagent/src/test/java/io/lumigo/javaagent/instrumentation/netty/v4_1/NettyTest.java +++ b/instrumentation/netty/netty-4.1/javaagent/src/test/java/io/lumigo/javaagent/instrumentation/netty/v4_1/NettyTest.java @@ -48,7 +48,6 @@ public static void setup() throws InterruptedException { server = new NettyServer(serverPort); server.start(); await().atMost(5, TimeUnit.SECONDS).until(() -> server.isReady()); - // Thread.sleep(1000); // Wait briefly to ensure the server is fully initialized } @Test From e8db685bc727e7891aa8fd5c7695f21e84e710c4 Mon Sep 17 00:00:00 2001 From: Eugene Orlovsky Date: Tue, 26 Nov 2024 08:43:05 +0100 Subject: [PATCH 6/6] test: netty test flaky --- settings.gradle | 1 - 1 file changed, 1 deletion(-) diff --git a/settings.gradle b/settings.gradle index e64c81d2a3..37cb638087 100644 --- a/settings.gradle +++ b/settings.gradle @@ -42,4 +42,3 @@ include "smoke-tests" include "testing:agent-for-testing" include "test-utils" include "utils" -