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:09:54 UTC
svn commit: r1658772 -
/lucene/dev/trunk/dev-tools/scripts/smokeTestRelease.py
Author: sarowe
Date: Tue Feb 10 18:09:53 2015
New Revision: 1658772
URL: http://svn.apache.org/r1658772
Log:
LUCENE-6231: retry all downloads in smokeTestRelease.py
Modified:
lucene/dev/trunk/dev-tools/scripts/smokeTestRelease.py
Modified: lucene/dev/trunk/dev-tools/scripts/smokeTestRelease.py
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/dev-tools/scripts/smokeTestRelease.py?rev=1658772&r1=1658771&r2=1658772&view=diff
==============================================================================
--- lucene/dev/trunk/dev-tools/scripts/smokeTestRelease.py (original)
+++ lucene/dev/trunk/dev-tools/scripts/smokeTestRelease.py Tue Feb 10 18:09:53 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:
@@ -866,7 +871,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')
@@ -1337,7 +1342,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: