CodingCat commented on code in PR #2237:
URL: 
https://github.com/apache/incubator-celeborn/pull/2237#discussion_r1468134978


##########
worker/src/test/scala/org/apache/celeborn/service/deploy/MiniClusterFeature.scala:
##########
@@ -98,22 +139,65 @@ trait MiniClusterFeature extends Logging {
     }
   }
 
-  def setUpMiniCluster(
+  private def setUpMiniCluster(
       masterConf: Map[String, String] = null,
       workerConf: Map[String, String] = null,
       workerNum: Int = 3): (Master, collection.Set[Worker]) = {
     val master = createMaster(masterConf)
-    val masterThread = runnerWrap(master.rpcEnv.awaitTermination())
+    val masterStartedSignal = Array(false)
+    val masterThread = new RunnerWrap({
+      try {
+        masterStartedSignal(0) = true
+        master.rpcEnv.awaitTermination()
+      } catch {
+        case ex: Exception =>
+          masterStartedSignal(0) = false
+          throw ex
+      }
+    })
     masterThread.start()
     masterInfo = (master, masterThread)
-    Thread.sleep(5000L)
-    (1 to workerNum).foreach { _ =>
-      val worker = createWorker(workerConf)
-      val workerThread = runnerWrap(worker.initialize())
-      workerThread.start()
-      workerInfos.put(worker, workerThread)
+    Thread.sleep(20000L)

Review Comment:
   sure, I changed the logic, it first wait for 5000, if master still not 
restarted, wait for at most 20 more seconds



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

Reply via email to