Skip to content

Commit 1d266a1

Browse files
authored
Increase default database timeout to 5 seconds (#7246)
1 parent 783163c commit 1d266a1

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/prefect/settings.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ def warn_on_database_password_value_without_usage(values):
522522

523523
PREFECT_ORION_DATABASE_TIMEOUT = Setting(
524524
Optional[float],
525-
default=1,
525+
default=5.0,
526526
)
527527
"""A statement timeout, in seconds, applied to all database
528528
interactions made by the API. Defaults to `1`.

tests/conftest.py

+3
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
PREFECT_ORION_ANALYTICS_ENABLED,
5050
PREFECT_ORION_BLOCKS_REGISTER_ON_START,
5151
PREFECT_ORION_DATABASE_CONNECTION_URL,
52+
PREFECT_ORION_DATABASE_TIMEOUT,
5253
PREFECT_ORION_SERVICES_FLOW_RUN_NOTIFICATIONS_ENABLED,
5354
PREFECT_ORION_SERVICES_LATE_RUNS_ENABLED,
5455
PREFECT_ORION_SERVICES_SCHEDULER_ENABLED,
@@ -295,6 +296,8 @@ def pytest_sessionstart(session):
295296
PREFECT_MEMOIZE_BLOCK_AUTO_REGISTRATION: False,
296297
# Disable auto-registration of block types as they can conflict
297298
PREFECT_ORION_BLOCKS_REGISTER_ON_START: False,
299+
# Use more aggressive database timeouts during testing
300+
PREFECT_ORION_DATABASE_TIMEOUT: 1,
298301
},
299302
source=__file__,
300303
)

0 commit comments

Comments
 (0)