Skip to content

Commit 01e813a

Browse files
committed
Small updates for store tests
1 parent 338bafd commit 01e813a

File tree

6 files changed

+8
-4
lines changed

6 files changed

+8
-4
lines changed

key-value/key-value-aio/src/key_value/aio/stores/elasticsearch/store.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,8 @@ async def _setup_collection(self, *, collection: str) -> None:
270270
except BadRequestError as e:
271271
if "index_already_exists_exception" in str(e).lower():
272272
return
273+
if "resource_already_exists_exception" in str(e).lower():
274+
return
273275
raise
274276

275277
def _get_index_name(self, collection: str) -> str:

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
ES_HOST = "localhost"
2424
ES_PORT = 9200
2525
ES_URL = f"http://{ES_HOST}:{ES_PORT}"
26-
ES_CONTAINER_PORT = 9200
26+
ES_CONTAINER_PORT = 19200
2727

2828
WAIT_FOR_ELASTICSEARCH_TIMEOUT = 30
2929

key-value/key-value-aio/tests/stores/opensearch/test_opensearch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
LOCALHOST = "localhost"
2626

2727
CONTAINER_PORT = 9200
28-
HOST_PORT = 19200
28+
HOST_PORT = 19201
2929

3030
OPENSEARCH_URL = f"http://{LOCALHOST}:{HOST_PORT}"
3131

key-value/key-value-sync/src/key_value/sync/code_gen/stores/elasticsearch/store.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,8 @@ def _setup_collection(self, *, collection: str) -> None:
242242
except BadRequestError as e:
243243
if "index_already_exists_exception" in str(e).lower():
244244
return
245+
if "resource_already_exists_exception" in str(e).lower():
246+
return
245247
raise
246248

247249
def _get_index_name(self, collection: str) -> str:

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
ES_HOST = "localhost"
2727
ES_PORT = 9200
2828
ES_URL = f"http://{ES_HOST}:{ES_PORT}"
29-
ES_CONTAINER_PORT = 9200
29+
ES_CONTAINER_PORT = 19200
3030

3131
WAIT_FOR_ELASTICSEARCH_TIMEOUT = 30
3232
# Released Apr 2025

key-value/key-value-sync/tests/code_gen/stores/opensearch/test_opensearch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
LOCALHOST = "localhost"
2929

3030
CONTAINER_PORT = 9200
31-
HOST_PORT = 19200
31+
HOST_PORT = 19201
3232

3333
OPENSEARCH_URL = f"http://{LOCALHOST}:{HOST_PORT}"
3434

0 commit comments

Comments
 (0)