You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ja...@apache.org on 2020/08/28 08:10:07 UTC
[lucene-solr] branch branch_8x updated: LUCENE-9485: Check early if
Solr port 8983 is available (#1792)
This is an automated email from the ASF dual-hosted git repository.
janhoy pushed a commit to branch branch_8x
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
The following commit(s) were added to refs/heads/branch_8x by this push:
new 1a7e536 LUCENE-9485: Check early if Solr port 8983 is available (#1792)
1a7e536 is described below
commit 1a7e53654cb644af3e4aa15aada6b915b7176331
Author: Jan Høydahl <ja...@users.noreply.github.com>
AuthorDate: Fri Aug 28 10:08:40 2020 +0200
LUCENE-9485: Check early if Solr port 8983 is available (#1792)
(cherry picked from commit 18e5f211784d2b595c71e052c135207ae2fffad4)
---
dev-tools/scripts/smokeTestRelease.py | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/dev-tools/scripts/smokeTestRelease.py b/dev-tools/scripts/smokeTestRelease.py
index 46a4fa9..1513295 100755
--- a/dev-tools/scripts/smokeTestRelease.py
+++ b/dev-tools/scripts/smokeTestRelease.py
@@ -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)