proxy: Make tests fail fast when test proxy exited early (#9432)

This currently happens when proxy is not compiled with feature
`testing`.
Also fix an adjacent function.
This commit is contained in:
Folke Behrens
2024-10-21 10:29:23 +02:00
committed by GitHub
parent cc25ef7342
commit ed958da38a

View File

@@ -3175,10 +3175,13 @@ class NeonProxy(PgProtocol):
# two seconds. Raises subprocess.TimeoutExpired if the proxy does not exit in time.
def wait_for_exit(self, timeout=2):
if self._popen:
self._popen.wait(timeout=2)
self._popen.wait(timeout=timeout)
@backoff.on_exception(backoff.expo, requests.exceptions.RequestException, max_time=10)
def _wait_until_ready(self):
assert (
self._popen and self._popen.poll() is None
), "Proxy exited unexpectedly. Check test log."
requests.get(f"http://{self.host}:{self.http_port}/v1/status")
def http_query(self, query, args, **kwargs):