Skip to content

Commit 0e3dafa

Browse files
authored
[3.3] Destroy application model after MetricsSupportTest (#15481)
* Destroy application model after MetricsSupportTest * Destroy application model after MethodMetricTest
1 parent a828eb4 commit 0e3dafa

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

dubbo-metrics/dubbo-metrics-api/src/test/java/org/apache/dubbo/metrics/MetricsSupportTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,19 @@
2929
import java.util.concurrent.ConcurrentHashMap;
3030
import java.util.concurrent.atomic.AtomicLong;
3131

32+
import org.junit.jupiter.api.AfterEach;
3233
import org.junit.jupiter.api.Assertions;
3334
import org.junit.jupiter.api.Test;
3435

3536
import static org.apache.dubbo.metrics.model.key.MetricsKey.METRIC_REQUESTS;
3637

3738
public class MetricsSupportTest {
3839

40+
@AfterEach
41+
public void destroy() {
42+
ApplicationModel.defaultModel().destroy();
43+
}
44+
3945
@Test
4046
void testFillZero() {
4147
ApplicationModel applicationModel = FrameworkModel.defaultModel().newApplication();

dubbo-metrics/dubbo-metrics-default/src/test/java/org/apache/dubbo/metrics/metrics/model/MethodMetricTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
import java.util.Map;
2929

30+
import org.junit.jupiter.api.AfterAll;
3031
import org.junit.jupiter.api.Assertions;
3132
import org.junit.jupiter.api.BeforeAll;
3233
import org.junit.jupiter.api.Test;
@@ -69,6 +70,11 @@ public static void setup() {
6970
.setUrl(URL.valueOf("test://test:11/test?accesslog=true&group=dubbo&version=1.1&side=consumer"));
7071
}
7172

73+
@AfterAll
74+
public static void destroy() {
75+
ApplicationModel.defaultModel().destroy();
76+
}
77+
7278
@Test
7379
void test() {
7480
MethodMetric metric =

0 commit comments

Comments
 (0)