diff --git a/airflow/utils/db.py b/airflow/utils/db.py index 1e2adbadbb79a..c289e7366ad15 100644 --- a/airflow/utils/db.py +++ b/airflow/utils/db.py @@ -691,6 +691,7 @@ def check_migrations(timeout): :param timeout: Timeout for the migration in seconds :return: None """ + timeout = timeout or 1 # run the loop at least 1 with _configured_alembic_environment() as env: context = env.get_context() source_heads = None diff --git a/tests/utils/test_db.py b/tests/utils/test_db.py index e2ea0168c3926..752f9873aaa5a 100644 --- a/tests/utils/test_db.py +++ b/tests/utils/test_db.py @@ -96,6 +96,7 @@ def test_default_connections_sort(self): def test_check_migrations(self): # Should run without error. Can't easily test the behaviour, but we can check it works + check_migrations(0) check_migrations(1) @mock.patch('alembic.command')