You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Tests fail with pydantic 2.14.0 and kubernetes 37.0.0 (freezegun) #4357
PydanticSchemaGenerationError: Unable to generate pydantic-core schema for <class 'freezegun.api.FakeDatetime'>.
Root cause: pydantic 2.14.0 can't define a model with a datetime field while freezegun is active. It matches field types against the real datetime.datetime captured at import (pydantic#13573), but freezegun replaces datetime.datetime with FakeDatetime.
kubernetes 37.0.0 triggers this: kubernetes.client now imports its pydantic models lazily on attribute access, and freeze_time reads every attribute of every loaded module when it starts, so these models get defined while frozen. The error escapes freeze_time and leaves the clock frozen, so other tests in the same worker fail too.
Workaround, verified with the full suite (3 of 3 runs green):
# src/tests/conftest.pyimportfreezegun# Workaround for https://github.com/dstackai/dstack/issues/4357freezegun.configure(extend_ignore_list=["kubernetes"])
It only stops freezegun from scanning kubernetes. The proper fix is replacing freezegun with time-machine, which doesn't swap datetime.datetime.
Activity
Replace freezegun with time-machine (#4360)