Make Tools/BuildSlaveSupport/wait-for-SVN-server.py handle server donwtime
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Sep 2014 14:47:21 +0000 (14:47 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Sep 2014 14:47:21 +0000 (14:47 +0000)
https://bugs.webkit.org/show_bug.cgi?id=137026

Patch by Tibor Meszaros <tmeszaros.u-szeged@partner.samsung.com> on 2014-09-23
Reviewed by Csaba Osztrogon√°c.

* BuildSlaveSupport/wait-for-SVN-server.py:
(getLatestSVNRevision):
(waitForSVNRevision):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173871 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/BuildSlaveSupport/wait-for-SVN-server.py
Tools/ChangeLog

index f093024a10886f148ca1631c0041f7ecb985842c..bf57ffad5558b29790d421a1c9249d146fefaefa 100755 (executable)
@@ -28,9 +28,14 @@ import subprocess
 
 
 def getLatestSVNRevision(SVNServer):
+    p = subprocess.Popen(["svn", "log", "--non-interactive", "--verbose", "--xml", "--limit=1", SVNServer], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+    response = p.communicate()[0]
+    if p.returncode != 0:
+        print "Can't connect to host: %s, return code %s " % (SVNServer, p.returncode)
+        print "OUTPUT:"
+        print response
+        return -1
     try:
-        p = subprocess.Popen(["svn", "log", "--non-interactive", "--verbose", "--xml", "--limit=1", SVNServer], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
-        response = p.communicate()[0]
         doc = xml.dom.minidom.parseString(response)
         el = doc.getElementsByTagName("logentry")[0]
         return el.getAttribute("revision")
@@ -52,7 +57,10 @@ def waitForSVNRevision(SVNServer, revision):
     revision = int(revision)
     while True:
         latestRevision = int(getLatestSVNRevision(SVNServer))
-        if latestRevision < revision:
+        if latestRevision == -1:
+            print "%s SVN server is unreachable. Sleeping for 60 seconds." % (SVNServer)
+            time.sleep(60)
+        elif latestRevision < revision:
             print "Latest SVN revision on %s is r%d, but we are waiting for r%d. Sleeping for 5 seconds." % (SVNServer, latestRevision, revision)
             time.sleep(5)
         else:
index fff0e4cf367f59f1a343212b304517edddc1a0ca..231dd093bbbcd704edf6c7e904b728e0b2adb3dd 100644 (file)
@@ -1,3 +1,14 @@
+2014-09-23  Tibor Meszaros  <tmeszaros.u-szeged@partner.samsung.com>
+
+        Make Tools/BuildSlaveSupport/wait-for-SVN-server.py handle server donwtime
+        https://bugs.webkit.org/show_bug.cgi?id=137026
+
+        Reviewed by Csaba Osztrogon√°c.
+
+        * BuildSlaveSupport/wait-for-SVN-server.py:
+        (getLatestSVNRevision):
+        (waitForSVNRevision):
+
 2014-09-23  Tibor Meszaros  <tmeszaros.u-szeged@partner.samsung.com>
 
         Remove unlinkZeroFiles from build-webkit