We have a system that we use in order to make some PUT requests during tests. The issue is that this system has, at the moment, some issues with its resources and sometimes it can't answer in time. We can't increase the read timeout to a value greater than 60 seconds for 2 reasons: if the system doesn't answer fast it most likely won't answer at all and secondly we're using a proxy which times out at 60 seconds.
I'm aware of this question , but waitForHttp or waitForPort don't fit our requirements as the port is available and there is no health endpoint telling us if the PUT request will succeed or just be lost.
Is there anything else we can do?
Example feature:
Background:
* url dep_url
* configure headers = read('classpath:package/headers/headers.json')
* retry until responseStatus !== 429
Scenario: Create entity
Given request read('classpath:package/body/' + file)
When path '/entity/' + entity[index]
And method put
Then assert responseStatus == 200 || responseStatus == 201
We need retries when a SocketTimeoutException is thrown, for example:
java.net.SocketTimeoutException: Read timed out, http call failed after 253 milliseconds for url