mirror of https://github.com/apache/lucene.git
LUCENE-9485: Check early if Solr port 8983 is available (#1792)
This commit is contained in:
parent
eb9f59f041
commit
18e5f21178
|
@ -796,7 +796,12 @@ def readSolrOutput(p, startupEvent, failureEvent, logFile):
|
|||
startupEvent.set()
|
||||
finally:
|
||||
f.close()
|
||||
|
||||
|
||||
def is_port_in_use(port):
|
||||
import socket
|
||||
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
|
||||
return s.connect_ex(('localhost', port)) == 0
|
||||
|
||||
def testSolrExample(unpackPath, javaPath, isSrc):
|
||||
# test solr using some examples it comes with
|
||||
logFile = '%s/solr-example.log' % unpackPath
|
||||
|
@ -1456,6 +1461,9 @@ def smokeTest(java, baseURL, gitRevision, version, tmpDir, isSigned, local_keys,
|
|||
download('KEYS', keysFileURL, tmpDir, force_clean=FORCE_CLEAN)
|
||||
keysFile = '%s/KEYS' % (tmpDir)
|
||||
|
||||
if is_port_in_use(8983):
|
||||
raise RuntimeError('Port 8983 is already in use. The smoketester needs it to test Solr')
|
||||
|
||||
print()
|
||||
print('Test Lucene...')
|
||||
checkSigs('lucene', lucenePath, version, tmpDir, isSigned, keysFile)
|
||||
|
|
Loading…
Reference in New Issue