Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions sdk/python/feast/infra/registry/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,15 +302,21 @@ def _sync_feast_metadata_to_projects_table(self):
# Find object in feast_metadata_projects but not in projects
projects_to_sync = set(feast_metadata_projects.keys()) - set(projects_set)
for project_name in projects_to_sync:
self.apply_project(
Project(
name=project_name,
created_timestamp=datetime.fromtimestamp(
feast_metadata_projects[project_name], tz=timezone.utc
try:
self.apply_project(
Project(
name=project_name,
created_timestamp=datetime.fromtimestamp(
feast_metadata_projects[project_name], tz=timezone.utc
),
),
),
commit=True,
)
commit=True,
)
except IntegrityError:
logger.info(
"Project %s already created in projects table by another process.",
project_name,
)

if self.purge_feast_metadata:
with self.write_engine.begin() as conn:
Expand Down
15 changes: 13 additions & 2 deletions sdk/python/tests/integration/rest_api/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ def get(self, endpoint, params=None):
return requests.get(url, params=params, verify=False)


def _wait_for_http_ready(route_url: str, timeout: int = 180, interval: int = 5) -> None:
def _wait_for_http_ready(
route_url: str,
timeout: int = 300,
interval: int = 5,
initial_delay: int = 30,
) -> None:
"""
Poll the HTTP endpoint until it returns a non-502 response.

Expand All @@ -46,9 +51,15 @@ def _wait_for_http_ready(route_url: str, timeout: int = 180, interval: int = 5)
start before the Feast server is ready, causing all requests to return 502.
"""
health_url = f"{route_url}/api/v1/projects"
deadline = time.time() + timeout
last_status = None

if initial_delay > 0:
print(
f"\n Waiting {initial_delay}s for backend to start after apply/dataset creation..."
)
time.sleep(initial_delay)

deadline = time.time() + timeout
print(
f"\n Waiting for HTTP endpoint to become ready (timeout={timeout}s): {health_url}"
)
Expand Down
Loading