You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by ra...@apache.org on 2025/11/26 15:37:30 UTC

(dubbo) branch 3.3 updated: Stabilize all the tests in ReferenceCacheTest.java (#15794)

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

rainyu 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 91cdd78bfc Stabilize all the tests in ReferenceCacheTest.java (#15794)
91cdd78bfc is described below

commit 91cdd78bfc97e6c07a5e4399c5d51fbad549b955
Author: Anshul Bisht <85...@users.noreply.github.com>
AuthorDate: Wed Nov 26 09:37:24 2025 -0600

    Stabilize all the tests in ReferenceCacheTest.java (#15794)
---
 .../org/apache/dubbo/config/utils/ReferenceCacheTest.java    | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/utils/ReferenceCacheTest.java b/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/utils/ReferenceCacheTest.java
index c324c53e06..d4bea3c1d1 100644
--- a/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/utils/ReferenceCacheTest.java
+++ b/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/utils/ReferenceCacheTest.java
@@ -19,9 +19,11 @@ package org.apache.dubbo.config.utils;
 import org.apache.dubbo.common.config.ReferenceCache;
 import org.apache.dubbo.config.ApplicationConfig;
 import org.apache.dubbo.config.RegistryConfig;
+import org.apache.dubbo.config.SysProps;
 import org.apache.dubbo.config.bootstrap.DubboBootstrap;
 import org.apache.dubbo.config.utils.service.FooService;
 
+import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 
@@ -34,11 +36,21 @@ class ReferenceCacheTest {
     @BeforeEach
     public void setUp() throws Exception {
         DubboBootstrap.reset();
+        SysProps.clear();
+        SysProps.setProperty("dubbo.metrics.enabled", "false");
+        SysProps.setProperty("dubbo.metrics.protocol", "disabled");
         MockReferenceConfig.setCounter(0);
         XxxMockReferenceConfig.setCounter(0);
         SimpleReferenceCache.CACHE_HOLDER.clear();
     }
 
+    @AfterEach
+    public void tearDown() {
+        DubboBootstrap.reset();
+        SysProps.clear();
+        SimpleReferenceCache.CACHE_HOLDER.clear();
+    }
+
     @Test
     void testGetCacheSameReference() throws Exception {
         ReferenceCache cache = SimpleReferenceCache.getCache();