merlimat closed pull request #1866: Make supervisord wait a single command
URL: https://github.com/apache/incubator-pulsar/pull/1866
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/tests/integration-tests-utils/src/main/java/org/apache/pulsar/tests/PulsarClusterUtils.java
 
b/tests/integration-tests-utils/src/main/java/org/apache/pulsar/tests/PulsarClusterUtils.java
index ca8e33b0d7..e5197600f9 100644
--- 
a/tests/integration-tests-utils/src/main/java/org/apache/pulsar/tests/PulsarClusterUtils.java
+++ 
b/tests/integration-tests-utils/src/main/java/org/apache/pulsar/tests/PulsarClusterUtils.java
@@ -200,24 +200,9 @@ public static boolean waitAllBrokersDown(DockerClient 
docker, String cluster) {
             .reduce(true, (accum, res) -> accum && res);
     }
 
-    public static boolean waitSupervisord(DockerClient docker, String 
containerId) {
-        int i = 50;
-        while (i > 0) {
-            try {
-                DockerUtils.runCommand(docker, containerId, "test", "-S", 
"/var/run/supervisor/supervisor.sock");
-                return true;
-            } catch (Exception e) {
-                // supervisord not running
-            }
-            try {
-                Thread.sleep(100);
-                i++;
-            } catch (InterruptedException ie) {
-                Thread.currentThread().interrupt();
-                break;
-            }
-        }
-        return false;
+    public static void waitSupervisord(DockerClient docker, String 
containerId) {
+        DockerUtils.runCommand(docker, containerId, "timeout", "60", "bash", 
"-c",
+                               "until test -S 
/var/run/supervisor/supervisor.sock; do sleep 0.1; done");
     }
 
     public static boolean startAllBrokers(DockerClient docker, String cluster) 
{


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to