tests : add DEFAULT_HTTP_TIMEOUT
This commit is contained in:
parent
9d65a3d65b
commit
08a756aea0
1 changed files with 4 additions and 4 deletions
|
@ -26,6 +26,9 @@ from re import RegexFlag
|
||||||
import wget
|
import wget
|
||||||
|
|
||||||
|
|
||||||
|
DEFAULT_HTTP_TIMEOUT = 10 if "LLAMA_SANITIZE" not in os.environ else 30
|
||||||
|
|
||||||
|
|
||||||
class ServerResponse:
|
class ServerResponse:
|
||||||
headers: dict
|
headers: dict
|
||||||
status_code: int
|
status_code: int
|
||||||
|
@ -88,10 +91,7 @@ class ServerProcess:
|
||||||
if "PORT" in os.environ:
|
if "PORT" in os.environ:
|
||||||
self.server_port = int(os.environ["PORT"])
|
self.server_port = int(os.environ["PORT"])
|
||||||
|
|
||||||
def start(self, timeout_seconds: int = 10) -> None:
|
def start(self, timeout_seconds: int | None = DEFAULT_HTTP_TIMEOUT) -> None:
|
||||||
if "LLAMA_SANITIZE" in os.environ:
|
|
||||||
timeout_seconds = 30
|
|
||||||
|
|
||||||
if "LLAMA_SERVER_BIN_PATH" in os.environ:
|
if "LLAMA_SERVER_BIN_PATH" in os.environ:
|
||||||
server_path = os.environ["LLAMA_SERVER_BIN_PATH"]
|
server_path = os.environ["LLAMA_SERVER_BIN_PATH"]
|
||||||
elif os.name == "nt":
|
elif os.name == "nt":
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue