From 790cff927e6121fcea68363fa26615ecf9e0e4e2 Mon Sep 17 00:00:00 2001 From: Miles Yucht Date: Tue, 14 Oct 2025 13:21:07 +0000 Subject: [PATCH 1/3] fix slow unit tests --- databricks/sdk/mixins/files.py | 1 + tests/conftest.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/databricks/sdk/mixins/files.py b/databricks/sdk/mixins/files.py index 2cdaf3532..fdf08a839 100644 --- a/databricks/sdk/mixins/files.py +++ b/databricks/sdk/mixins/files.py @@ -1337,6 +1337,7 @@ def extended_is_retryable(e: BaseException) -> Optional[str]: # where we believe request didn't reach the server is_retryable=extended_is_retryable, before_retry=before_retry, + clock=self._config.clock, )(delegate)() def _open_download_stream( diff --git a/tests/conftest.py b/tests/conftest.py index 9dddc16a2..5cd6a855f 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -6,6 +6,7 @@ from pyfakefs.fake_filesystem_unittest import Patcher from databricks.sdk.core import Config +from databricks.sdk.clock import FakeClock from databricks.sdk.credentials_provider import credentials_strategy from .integration.conftest import restorable_env # type: ignore @@ -18,7 +19,7 @@ def noop_credentials(_: any): @pytest.fixture def config(): - return Config(host="http://localhost", credentials_strategy=noop_credentials) + return Config(host="http://localhost", credentials_strategy=noop_credentials, clock=FakeClock()) @pytest.fixture From 4d9a2b59e0ccea736ae88451e9dfcf75621b1796 Mon Sep 17 00:00:00 2001 From: Miles Yucht Date: Tue, 14 Oct 2025 13:58:32 +0000 Subject: [PATCH 2/3] fix --- tests/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 5cd6a855f..f2c2ef04c 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -5,8 +5,8 @@ import pytest as pytest from pyfakefs.fake_filesystem_unittest import Patcher +from .clock import FakeClock from databricks.sdk.core import Config -from databricks.sdk.clock import FakeClock from databricks.sdk.credentials_provider import credentials_strategy from .integration.conftest import restorable_env # type: ignore From a66775bf2bbc99bf05a8cf4d6ba639843d5b3dd2 Mon Sep 17 00:00:00 2001 From: Miles Yucht Date: Tue, 14 Oct 2025 14:07:31 +0000 Subject: [PATCH 3/3] fix --- tests/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index f2c2ef04c..cb2efc0a2 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -5,10 +5,10 @@ import pytest as pytest from pyfakefs.fake_filesystem_unittest import Patcher -from .clock import FakeClock from databricks.sdk.core import Config from databricks.sdk.credentials_provider import credentials_strategy +from .clock import FakeClock from .integration.conftest import restorable_env # type: ignore