Skip to content

Commit

Permalink
ci: add retry to elastic search ingest test (#1581)
Browse files Browse the repository at this point in the history
Occasionally the es test can fail because the index fail to be created
on the first try. Experiments show adding timeout doesn't help but add
retry mitigates the issue. See history of commits in branch:
yao/bump-inference-to-0.6.6
#1563

---------

Co-authored-by: ryannikolaidis <[email protected]>
Co-authored-by: badGarnet <[email protected]>
  • Loading branch information
3 people authored Sep 29, 2023
1 parent 5b994f3 commit af7639e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## 0.10.19-dev0

## 0.10.18

### Enhancements
Expand Down
6 changes: 4 additions & 2 deletions scripts/elasticsearch-test-helpers/create_and_fill_es.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
)

print("Connecting to the Elasticsearch cluster.")
es = Elasticsearch(CLUSTER_URL)
es = Elasticsearch(CLUSTER_URL, request_timeout=30)
print(es.info())
df = pd.read_csv(DATA_PATH).dropna().reset_index()

print("Creating an Elasticsearch index for testing elasticsearch ingest.")
es.indices.create(index=INDEX_NAME, mappings=MAPPINGS)
response = es.options(max_retries=5).indices.create(index=INDEX_NAME, mappings=MAPPINGS)
if response.meta.status != 200:
raise RuntimeError("failed to create index")

print("Loading data into the index.")
bulk_data = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"issue_key": "JCTP2-8"
},
"date_created": "2023-08-22T11:35:48.407+0000",
"date_modified": "2023-08-29T11:46:18.193+0000"
"date_modified": "2023-09-29T05:55:11.066+0000"
},
"filetype": "text/plain",
"languages": [
Expand All @@ -30,7 +30,7 @@
"issue_key": "JCTP2-8"
},
"date_created": "2023-08-22T11:35:48.407+0000",
"date_modified": "2023-08-29T11:46:18.193+0000"
"date_modified": "2023-09-29T05:55:11.066+0000"
},
"filetype": "text/plain",
"languages": [
Expand All @@ -50,7 +50,7 @@
"issue_key": "JCTP2-8"
},
"date_created": "2023-08-22T11:35:48.407+0000",
"date_modified": "2023-08-29T11:46:18.193+0000"
"date_modified": "2023-09-29T05:55:11.066+0000"
},
"filetype": "text/plain",
"languages": [
Expand All @@ -70,7 +70,7 @@
"issue_key": "JCTP2-8"
},
"date_created": "2023-08-22T11:35:48.407+0000",
"date_modified": "2023-08-29T11:46:18.193+0000"
"date_modified": "2023-09-29T05:55:11.066+0000"
},
"filetype": "text/plain",
"languages": [
Expand All @@ -90,7 +90,7 @@
"issue_key": "JCTP2-8"
},
"date_created": "2023-08-22T11:35:48.407+0000",
"date_modified": "2023-08-29T11:46:18.193+0000"
"date_modified": "2023-09-29T05:55:11.066+0000"
},
"filetype": "text/plain",
"languages": [
Expand All @@ -110,7 +110,7 @@
"issue_key": "JCTP2-8"
},
"date_created": "2023-08-22T11:35:48.407+0000",
"date_modified": "2023-08-29T11:46:18.193+0000"
"date_modified": "2023-09-29T05:55:11.066+0000"
},
"filetype": "text/plain",
"languages": [
Expand All @@ -130,7 +130,7 @@
"issue_key": "JCTP2-8"
},
"date_created": "2023-08-22T11:35:48.407+0000",
"date_modified": "2023-08-29T11:46:18.193+0000"
"date_modified": "2023-09-29T05:55:11.066+0000"
},
"filetype": "text/plain",
"languages": [
Expand All @@ -150,7 +150,7 @@
"issue_key": "JCTP2-8"
},
"date_created": "2023-08-22T11:35:48.407+0000",
"date_modified": "2023-08-29T11:46:18.193+0000"
"date_modified": "2023-09-29T05:55:11.066+0000"
},
"filetype": "text/plain",
"languages": [
Expand All @@ -170,7 +170,7 @@
"issue_key": "JCTP2-8"
},
"date_created": "2023-08-22T11:35:48.407+0000",
"date_modified": "2023-08-29T11:46:18.193+0000"
"date_modified": "2023-09-29T05:55:11.066+0000"
},
"filetype": "text/plain",
"languages": [
Expand All @@ -190,7 +190,7 @@
"issue_key": "JCTP2-8"
},
"date_created": "2023-08-22T11:35:48.407+0000",
"date_modified": "2023-08-29T11:46:18.193+0000"
"date_modified": "2023-09-29T05:55:11.066+0000"
},
"filetype": "text/plain",
"languages": [
Expand All @@ -210,7 +210,7 @@
"issue_key": "JCTP2-8"
},
"date_created": "2023-08-22T11:35:48.407+0000",
"date_modified": "2023-08-29T11:46:18.193+0000"
"date_modified": "2023-09-29T05:55:11.066+0000"
},
"filetype": "text/plain",
"languages": [
Expand Down
2 changes: 1 addition & 1 deletion unstructured/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.10.18" # pragma: no cover
__version__ = "0.10.19-dev0" # pragma: no cover

0 comments on commit af7639e

Please sign in to comment.