Skip to content

Commit

Permalink
Update test_0007_timeBetweenRequestsOnSameConnection for unified prox…
Browse files Browse the repository at this point in the history
…y session httpAdapter

Signed-off-by: Andre Kurait <akurait@amazon.com>
  • Loading branch information
AndreKurait committed May 16, 2024
1 parent 455a97b commit 82690c5
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions test/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,11 +316,9 @@ def test_0007_timeBetweenRequestsOnSameConnection(self):
# requests on the same connection on the proxy that has a minute gap
seconds_between_requests = 60 # 1 minute

# Set a consistent session to be used for this test
session = Session()
proxy_single_connection_session = Session()
adapter = HTTPAdapter(pool_connections=1, pool_maxsize=1, max_retries=1)
session.mount('http://', adapter)
session.mount('https://', adapter)
proxy_single_connection_session.mount(self.proxy_endpoint, adapter)

index_name = f"test_0007_{self.unique_id}"

Expand All @@ -329,7 +327,7 @@ def test_0007_timeBetweenRequestsOnSameConnection(self):
for doc_id_int in range(number_of_docs):
doc_id = str(doc_id_int)
proxy_response = create_document(self.proxy_endpoint, index_name, doc_id, self.source_auth,
self.source_verify_ssl, session)
self.source_verify_ssl, proxy_single_connection_session)
self.assertEqual(proxy_response.status_code, HTTPStatus.CREATED)

if doc_id_int + 1 < number_of_docs:
Expand All @@ -340,4 +338,4 @@ def test_0007_timeBetweenRequestsOnSameConnection(self):
doc_id = str(doc_id_int)
self.assert_source_target_doc_match(index_name, doc_id)
finally:
session.close()
proxy_single_connection_session.close()

0 comments on commit 82690c5

Please sign in to comment.