zrlw commented on a change in pull request #9015:
URL: https://github.com/apache/dubbo/pull/9015#discussion_r735235977



##########
File path: 
dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/KeepRunningOnSpringClosedTest.java
##########
@@ -45,8 +45,15 @@ public void test(){
             providerContext.start();
 
             // Expect 1: dubbo application state is STARTED after spring 
context start finish.
-            // No need check and wait
-
+            // wait ContextStartedEvent as spring context start on async mode.
+            ApplicationStartup applicationStartup = 
providerContext.getBean(ApplicationStartup.class);
+            for (int i = 0; i < 10; i++) {
+                if (applicationStartup.isStarted()) {
+                    break;
+                }
+                Thread.sleep(1000);

Review comment:
       i run as junit test, nine of ten tests failed if do not add these check.
   ```
    Assertions.assertEquals(DeployState.STARTED, 
dubboStateListener.getState()); <== the state is often STARTING not STARTED if 
do not wait for application startup event notice.
   ```
   




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