Hi, I’m stuck with this issue since a month now & I have no idea what other solutions are possible.
So we have a microservice springboot API hosted on my localhost & I have automated the testing using Python scripts. Request, response is json.
When I make a POST request with json body, first request goes through & passes
Subsequent calls to POST, fail with Connection Error in adapter.py - requests.exceptions.ConnectionError: (‘Connection aborted.’, FileNotFoundError(2, ‘No such file or directory’))
I have am not reading any file outside the test so I don’t get why FileNotFound.
When I debug, I see no response from httplib_response = self._make_request(…) in connectionpool.py & ends up going to EmptyPoolError.
Any number of consecutive GET, PATCH methods pass without this issue. Only Post is failing.
Manual test works fine any number of times on Postman.
Please suggest how to resolve this blocker.
My code -
def test_check_decrypt_API():
sample_ciphertext = “ahufjsdjkf”
# Open a new session
s = requests.session()
s.headers.update(header)
# Post the API request
response = s.post(decryptUrl, json={"Encoded_Data": sample_ciphertext, }, headers=header, verify=False)
# Verify response
print(response.json())
assert response.status_code == 200
response.close()