You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sa...@apache.org on 2015/02/10 19:10:43 UTC

svn commit: r1658774 - in /lucene/dev/branches/branch_5x: ./ dev-tools/ dev-tools/scripts/smokeTestRelease.py

Author: sarowe
Date: Tue Feb 10 18:10:43 2015
New Revision: 1658774

URL: http://svn.apache.org/r1658774
Log:
LUCENE-6231: retry all downloads in smokeTestRelease.py (merged trunk r1658772)

Modified:
    lucene/dev/branches/branch_5x/   (props changed)
    lucene/dev/branches/branch_5x/dev-tools/   (props changed)
    lucene/dev/branches/branch_5x/dev-tools/scripts/smokeTestRelease.py

Modified: lucene/dev/branches/branch_5x/dev-tools/scripts/smokeTestRelease.py
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/dev-tools/scripts/smokeTestRelease.py?rev=1658774&r1=1658773&r2=1658774&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/dev-tools/scripts/smokeTestRelease.py (original)
+++ lucene/dev/branches/branch_5x/dev-tools/scripts/smokeTestRelease.py Tue Feb 10 18:10:43 2015
@@ -95,7 +95,7 @@ def getHREFs(urlString):
 
   links = []
   try:
-    html = urllib.request.urlopen(urlString).read().decode('UTF-8')
+    html = load(urlString)
   except:
     print('\nFAILED to open url %s' % urlString)
     traceback.print_exc()
@@ -146,7 +146,12 @@ def attemptDownload(urlString, fileName)
       os.remove(fileName)
 
 def load(urlString):
-  return urllib.request.urlopen(urlString).read().decode('utf-8')
+  try:
+    content = urllib.request.urlopen(urlString).read().decode('utf-8')
+  except Exception as e:
+    print('Retrying download of url %s after exception: %s' % (urlString, e))
+    content = urllib.request.urlopen(urlString).read().decode('utf-8')
+  return content
 
 def noJavaPackageClasses(desc, file):
   with zipfile.ZipFile(file) as z2:
@@ -900,7 +905,7 @@ def testSolrExample(unpackPath, javaPath
     print('      index example docs...')
     run('java -Durl=http://localhost:8983/solr/techproducts/update -jar ./exampledocs/post.jar ./exampledocs/*.xml', 'post-example-docs.log')
     print('      run query...')
-    s = urllib.request.urlopen('http://localhost:8983/solr/techproducts/select/?q=video').read().decode('UTF-8')
+    s = load('http://localhost:8983/solr/techproducts/select/?q=video')
     if s.find('<result name="response" numFound="3" start="0">') == -1:
       print('FAILED: response is:\n%s' % s)
       raise RuntimeError('query on solr example instance failed')
@@ -1374,7 +1379,7 @@ reVersion1 = re.compile(r'\>(\d+)\.(\d+)
 reVersion2 = re.compile(r'-(\d+)\.(\d+)\.(\d+)(-alpha|-beta)?\.', re.IGNORECASE)
 
 def getAllLuceneReleases():
-  s = urllib.request.urlopen('https://archive.apache.org/dist/lucene/java').read().decode('UTF-8')
+  s = load('https://archive.apache.org/dist/lucene/java')
 
   releases = set()
   for r in reVersion1, reVersion2: