server.stop()
-@pytest.fixture(scope="module", autouse=True)
-def do_something():
+@pytest.fixture(scope="session", autouse=True)
+def load_server_presets():
# this will be run once per test session, before any tests
ServerPreset.load_all()
if [ $# -lt 1 ]
then
if [[ "${SLOW_TESTS:-0}" == 1 ]]; then
- pytest -v -x
+ pytest --durations=30 -v -x
else
- pytest -v -x -m "not slow"
+ pytest --durations=30 -v -x -m "not slow"
fi
else
- pytest "$@"
+ pytest --durations=30 "$@"
fi
last_status = _get_model_status(model_id)
if last_status in desired:
return last_status
- time.sleep(1)
+ time.sleep(0.01)
raise AssertionError(
f"Timed out waiting for {model_id} to reach {desired}, last status: {last_status}"
)
while time.time() < deadline:
if any(e.get("event") == event_type and e.get("model") == model for e in collected):
return True
- time.sleep(0.5)
+ time.sleep(0.01)
return False
# wait for server to start
start_time = time.time()
+ last_print_time = start_time
while time.time() - start_time < timeout_seconds:
try:
response = self.make_request("GET", "/health", headers={
if self.process.poll() is not None:
raise RuntimeError(f"Server process died with return code {self.process.returncode}")
- print(f"Waiting for server to start...")
- time.sleep(0.5)
+ if time.time() - last_print_time >= 1.0:
+ print(f"Waiting for server to start...")
+ last_print_time = time.time()
+ time.sleep(0.01)
raise TimeoutError(f"Server did not start within {timeout_seconds} seconds")
def stop(self) -> None: