Skip to content

Commit

Permalink
fail if smoke tester hits exc reading Solr output
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/branch_4x@1375341 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
mikemccand committed Aug 21, 2012
1 parent 0606579 commit 0007ad5
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions dev-tools/scripts/smokeTestRelease.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ def testNotice(unpackPath):
if solrNotice.find(expected) == -1:
raise RuntimeError('Solr\'s NOTICE.txt does not have the verbatim copy, plus header/footer, of Lucene\'s NOTICE.txt')

def readSolrOutput(p, startupEvent, logFile):
def readSolrOutput(p, startupEvent, failureEvent, logFile):
f = open(logFile, 'wb')
try:
while True:
Expand All @@ -556,8 +556,13 @@ def readSolrOutput(p, startupEvent, logFile):
f.write(line)
f.flush()
# print 'SOLR: %s' % line.strip()
if line.decode('UTF-8').find('Started [email protected]:8983') != -1:
if not startupEvent.isSet() and line.find(b'Started [email protected]:8983') != -1:
startupEvent.set()
except:
print()
print('Exception reading Solr output:')
traceback.print_exc()
failureEvent.set()
finally:
f.close()

Expand All @@ -572,7 +577,8 @@ def testSolrExample(unpackPath, javaPath, isSrc):
server = subprocess.Popen(['java', '-jar', 'start.jar'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env)

startupEvent = threading.Event()
serverThread = threading.Thread(target=readSolrOutput, args=(server.stderr, startupEvent, logFile))
failureEvent = threading.Event()
serverThread = threading.Thread(target=readSolrOutput, args=(server.stderr, startupEvent, failureEvent, logFile))
serverThread.setDaemon(True)
serverThread.start()

Expand Down Expand Up @@ -609,6 +615,9 @@ def testSolrExample(unpackPath, javaPath, isSrc):
# Shouldn't happen unless something is seriously wrong...
print('***WARNING***: Solr instance didn\'t respond to SIGKILL; ignoring...')

if failureEvent.isSet():
raise RuntimeError('exception while reading Solr output')

os.chdir('..')

def checkJavadocpath(path):
Expand Down

0 comments on commit 0007ad5

Please sign in to comment.