This is an automated email from the ASF dual-hosted git repository.

albumenj pushed a commit to branch 3.3
in repository https://gitbox.apache.org/repos/asf/dubbo.git


The following commit(s) were added to refs/heads/3.3 by this push:
     new 044f620cc7 optimized testExporterThreadpoolName by starting dispatcher 
thread directly (#15241)
044f620cc7 is described below

commit 044f620cc7e381c450a87fddf74f1ad8803583fd
Author: zrlw <[email protected]>
AuthorDate: Mon Mar 17 09:56:37 2025 +0800

    optimized testExporterThreadpoolName by starting dispatcher thread directly 
(#15241)
---
 .../metrics/prometheus/PrometheusMetricsThreadPoolTest.java      | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git 
a/dubbo-metrics/dubbo-metrics-prometheus/src/test/java/org/apache/dubbo/metrics/prometheus/PrometheusMetricsThreadPoolTest.java
 
b/dubbo-metrics/dubbo-metrics-prometheus/src/test/java/org/apache/dubbo/metrics/prometheus/PrometheusMetricsThreadPoolTest.java
index 83b062e1c1..2727b34980 100644
--- 
a/dubbo-metrics/dubbo-metrics-prometheus/src/test/java/org/apache/dubbo/metrics/prometheus/PrometheusMetricsThreadPoolTest.java
+++ 
b/dubbo-metrics/dubbo-metrics-prometheus/src/test/java/org/apache/dubbo/metrics/prometheus/PrometheusMetricsThreadPoolTest.java
@@ -100,11 +100,6 @@ public class PrometheusMetricsThreadPoolTest {
         PrometheusMetricsReporter reporter = new 
PrometheusMetricsReporter(metricsConfig.toUrl(), applicationModel);
         reporter.init();
         exportHttpServer(reporter, port);
-        try {
-            Thread.sleep(5000);
-        } catch (InterruptedException e) {
-            throw new RuntimeException(e);
-        }
         if (metricsConfig.getEnableThreadpool()) {
             metricsCollector.registryDefaultSample();
         }
@@ -135,8 +130,8 @@ public class PrometheusMetricsThreadPoolTest {
                     os.write(response.getBytes());
                 }
             });
-            Thread httpServerThread = new 
Thread(prometheusExporterHttpServer::start);
-            httpServerThread.start();
+            // start ServerImpl dispatcher thread.
+            prometheusExporterHttpServer.start();
         } catch (IOException e) {
             throw new RuntimeException(e);
         }

Reply via email to