forked from mdodsworth/lucene-solr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fail if smoke tester hits exc reading Solr output
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/branch_4x@1375341 13f79535-47bb-0310-9956-ffa450edef68
- Loading branch information
1 parent
0606579
commit 0007ad5
Showing
1 changed file
with
12 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | ||
|
@@ -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() | ||
|
||
|
@@ -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() | ||
|
||
|
@@ -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): | ||
|