pinxiong opened a new issue #9137:
URL: https://github.com/apache/dubbo/issues/9137


   <!-- If you need to report a security issue please visit 
https://github.com/apache/dubbo/security/policy -->
   
   - [x] I have searched the [issues](https://github.com/apache/dubbo/issues) 
of this repository and believe that this is not a duplicate.
   - [x] I have searched the [release 
notes](https://github.com/apache/dubbo/releases) of this repository and believe 
that this is not a duplicate.
   
   ## Describe the feature
   <!-- Please also discuss possible business value -->
   
   Registry center is used in many unit tests, especially `dubbo-config-api`, 
`dubbo-config-spring` and `dubbo-test-spring` modules. 
   
   Generallly, we use `zookeeper` as the default registry center.  We need to 
start `zookeeper` before executing each unit test and shut it down after 
executed. Also, we need to refer `zookeeper` in the code to manage its 
lifecycle below
   
   ```java
   public class GenericServiceTest {
       // define registry center
       private static RegistryCenter singleRegistryCenter;
   
       @BeforeAll
       public static void beforeAll() {
           // start registry center
           singleRegistryCenter = new ZookeeperSingleRegistryCenter();
           singleRegistryCenter.startup();
           DubboBootstrap.reset();
       }
   
       @AfterAll
       public static void afterAll() {
           DubboBootstrap.reset();
           // stop registry center
           singleRegistryCenter.shutdown();
       }
       ...
   }
   ```
   
   So, I hope we can define a global registry center in each test plan to 
reduce the times of `zookeeper`'s startup and shutdown. More importantly, we 
can use registry center directly without invading any code.


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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to