codelipenghui commented on code in PR #23612:
URL: https://github.com/apache/pulsar/pull/23612#discussion_r1848843945


##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/stats/prometheus/PrometheusMetricsGeneratorTest.java:
##########
@@ -32,13 +32,22 @@
 import java.util.Random;
 import java.util.concurrent.ExecutionException;
 import java.util.zip.GZIPInputStream;
+import lombok.Cleanup;
 import org.apache.commons.io.IOUtils;
 import org.apache.pulsar.broker.PulsarService;
 import org.apache.pulsar.broker.ServiceConfiguration;
+import org.apache.pulsar.common.util.SimpleTextOutputStream;
+import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
 public class PrometheusMetricsGeneratorTest {
 
+
+    @BeforeClass
+    public static void setProperties() {
+        System.setProperty("io.netty.noUnsafe", "true");

Review Comment:
   @zymap Instead of setting properties, you can just mock a PlatformDependent 
to return true or false for unit testing.



-- 
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