Copilot commented on code in PR #8137:
URL: https://github.com/apache/hbase/pull/8137#discussion_r3139318516


##########
hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestCallRunner.java:
##########
@@ -41,31 +40,26 @@
 import org.apache.hadoop.hbase.testclassification.RPCTests;
 import org.apache.hadoop.hbase.testclassification.SmallTests;
 import org.apache.hadoop.hbase.trace.TraceUtil;
-import org.junit.Before;
-import org.junit.ClassRule;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import org.junit.rules.TestName;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.TestInfo;
+import org.junit.jupiter.api.extension.RegisterExtension;
 import org.mockito.Mockito;
 
-@Category({ RPCTests.class, SmallTests.class })
+@Tag(RPCTests.TAG)
+@Tag(SmallTests.TAG)
 public class TestCallRunner {
 
-  @ClassRule
-  public static final HBaseClassTestRule CLASS_RULE =
-    HBaseClassTestRule.forClass(TestCallRunner.class);
-
-  @Rule
-  public TestName testName = new TestName();
-
-  @Rule
-  public OpenTelemetryRule otelRule = OpenTelemetryRule.create();
+  @RegisterExtension
+  public static final OpenTelemetryExtension otelRule = 
OpenTelemetryExtension.create();

Review Comment:
   Registering `OpenTelemetryExtension` as a static extension makes it shared 
across all test methods in the class, which can cause cross-test contamination 
(e.g., spans from earlier tests remaining visible) and increase flakiness risk. 
Prefer an instance `@RegisterExtension` (non-static) so each test gets a fresh 
extension instance, or explicitly reset/clear collected spans in `@BeforeEach` 
if the extension supports it.
   ```suggestion
     public final OpenTelemetryExtension otelRule = 
OpenTelemetryExtension.create();
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to