Skip to content

Commit 313e702

Browse files
committed
Use host port for ES tests
1 parent 01e813a commit 313e702

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

key-value/key-value-aio/tests/stores/elasticsearch/test_elasticsearch.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121

2222
TEST_SIZE_LIMIT = 1 * 1024 * 1024 # 1MB
2323
ES_HOST = "localhost"
24-
ES_PORT = 9200
25-
ES_URL = f"http://{ES_HOST}:{ES_PORT}"
26-
ES_CONTAINER_PORT = 19200
24+
CONTAINER_PORT = 9200
25+
HOST_PORT = 19200
26+
ES_URL = f"http://{ES_HOST}:{HOST_PORT}"
2727

2828
WAIT_FOR_ELASTICSEARCH_TIMEOUT = 30
2929

@@ -90,7 +90,7 @@ async def setup_elasticsearch(self, request: pytest.FixtureRequest) -> AsyncGene
9090
with docker_container(
9191
f"elasticsearch-test-{version}",
9292
es_image,
93-
{str(ES_CONTAINER_PORT): ES_PORT},
93+
{str(CONTAINER_PORT): HOST_PORT},
9494
{"discovery.type": "single-node", "xpack.security.enabled": "false"},
9595
):
9696
if not await async_wait_for_true(bool_fn=ping_elasticsearch, tries=WAIT_FOR_ELASTICSEARCH_TIMEOUT, wait_time=2):

key-value/key-value-sync/tests/code_gen/stores/elasticsearch/test_elasticsearch.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424

2525
TEST_SIZE_LIMIT = 1 * 1024 * 1024 # 1MB
2626
ES_HOST = "localhost"
27-
ES_PORT = 9200
28-
ES_URL = f"http://{ES_HOST}:{ES_PORT}"
29-
ES_CONTAINER_PORT = 19200
27+
CONTAINER_PORT = 9200
28+
HOST_PORT = 19200
29+
ES_URL = f"http://{ES_HOST}:{HOST_PORT}"
3030

3131
WAIT_FOR_ELASTICSEARCH_TIMEOUT = 30
3232
# Released Apr 2025
@@ -91,7 +91,7 @@ def setup_elasticsearch(self, request: pytest.FixtureRequest) -> Generator[None,
9191
with docker_container(
9292
f"elasticsearch-test-{version}",
9393
es_image,
94-
{str(ES_CONTAINER_PORT): ES_PORT},
94+
{str(CONTAINER_PORT): HOST_PORT},
9595
{"discovery.type": "single-node", "xpack.security.enabled": "false"},
9696
):
9797
if not wait_for_true(bool_fn=ping_elasticsearch, tries=WAIT_FOR_ELASTICSEARCH_TIMEOUT, wait_time=2):

0 commit comments

Comments
 (0)