Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reducing wait interval for BQ integration tests #1827

Merged
merged 3 commits into from
Sep 3, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 6 additions & 0 deletions sdk/python/feast/infra/offline_stores/bigquery.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import uuid
from datetime import date, datetime, timedelta
from typing import Dict, List, Optional, Union
Expand Down Expand Up @@ -222,6 +223,11 @@ def block_until_done(
BigQueryJobCancelled exception to signify when that the job has been cancelled (i.e. from timeout or KeyboardInterrupt).
"""

# For test environments, retry more aggressively
woop marked this conversation as resolved.
Show resolved Hide resolved
is_test = os.getenv("IS_TEST", default=None) == "TRUE"
if is_test:
retry_cadence = 1

def _wait_until_done(job_id):
if client.get_job(job_id).state in ["PENDING", "RUNNING"]:
raise BigQueryJobStillRunning(job_id=job_id)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import tempfile
import uuid
from contextlib import contextmanager
Expand Down Expand Up @@ -162,6 +163,7 @@ def construct_test_environment(
test_repo_config: IntegrationTestRepoConfig,
test_suite_name: str = "integration_test",
) -> Environment:
os.environ["IS_TEST"] = "TRUE"
adchia marked this conversation as resolved.
Show resolved Hide resolved
project = f"{test_suite_name}_{str(uuid.uuid4()).replace('-', '')[:8]}"

offline_creator: DataSourceCreator = test_repo_config.offline_store_creator(project)
Expand Down