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

rexxiong pushed a commit to branch branch-0.5
in repository https://gitbox.apache.org/repos/asf/celeborn.git


The following commit(s) were added to refs/heads/branch-0.5 by this push:
     new bdb64c6e3 [CELEBORN-1615][FOLLOWUP][0.5] Sleep for http server 
initialization in UT
bdb64c6e3 is described below

commit bdb64c6e36d1664143cf9e2ed3d31baa1ca68d61
Author: Wang, Fei <[email protected]>
AuthorDate: Wed Oct 9 22:55:55 2024 +0800

    [CELEBORN-1615][FOLLOWUP][0.5] Sleep for http server initialization in UT
    
    ### What changes were proposed in this pull request?
    
    As title.
    ### Why are the changes needed?
    
    The  branch-0.5 UT failed  with connection refused issue after merging 
https://github.com/apache/celeborn/pull/2764, which starts the http server 
later than before, seems the http server initialization was not finished during 
UT execution.
    
    The RC is that, there is no sleep after the master init thread start.
    
https://github.com/apache/celeborn/blob/c3d33daabc6360f9ac7a8c397ae57d71fab094e4/master/src/test/scala/org/apache/celeborn/service/deploy/master/http/api/ApiMasterResourceSuite.scala#L54-L59
    
    And in main branch,  it will sleep 1 second for initialization before UT 
execution.
    
    
https://github.com/apache/celeborn/blob/c3d33daabc6360f9ac7a8c397ae57d71fab094e4/service/src/test/scala/org/apache/celeborn/server/common/http/HttpTestHelper.scala#L64-L68
    
    So, the UT is stable in main branch but failed in branch-0.5.
    
    ### Does this PR introduce _any_ user-facing change?
    No.
    
    ### How was this patch tested?
    
    GA
    
    Closes #2794 from turboFei/sleep_1.
    
    Authored-by: Wang, Fei <[email protected]>
    Signed-off-by: Shuang <[email protected]>
---
 .../scala/org/apache/celeborn/server/common/http/HttpTestHelper.scala    | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/service/src/test/scala/org/apache/celeborn/server/common/http/HttpTestHelper.scala
 
b/service/src/test/scala/org/apache/celeborn/server/common/http/HttpTestHelper.scala
index 8674fc39c..6a6ee9242 100644
--- 
a/service/src/test/scala/org/apache/celeborn/server/common/http/HttpTestHelper.scala
+++ 
b/service/src/test/scala/org/apache/celeborn/server/common/http/HttpTestHelper.scala
@@ -64,6 +64,7 @@ trait HttpTestHelper extends AnyFunSuite
   override def beforeAll(): Unit = {
     super.beforeAll()
     restApiBaseSuite.setUp()
+    Thread.sleep(1000) // sleep for http server initialization
   }
 
   override def afterAll(): Unit = {

Reply via email to