fix: correct http timeout configs‘ default values and ignorance by HttpRequestNode (#7762)

This commit is contained in:
Bowen Liang 2024-08-30 19:09:10 +08:00 • committed by GitHub
commit 0c2a62f847
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 23 additions and 22 deletions

View file

@ -19,6 +19,7 @@ def example_env_file(tmp_path, monkeypatch) -> str:
"""
CONSOLE_API_URL=https://example.com
CONSOLE_WEB_URL=https://example.com
HTTP_REQUEST_MAX_WRITE_TIMEOUT=30
"""
)
)
@ -48,6 +49,12 @@ def test_dify_config(example_env_file):
assert config.API_COMPRESSION_ENABLED is False
assert config.SENTRY_TRACES_SAMPLE_RATE == 1.0
# annotated field with default value
assert config.HTTP_REQUEST_MAX_READ_TIMEOUT == 60
# annotated field with configured value
assert config.HTTP_REQUEST_MAX_WRITE_TIMEOUT == 30
# NOTE: If there is a `.env` file in your Workspace, this test might not succeed as expected.
# This is due to `pymilvus` loading all the variables from the `.env` file into `os.environ`.