Skip to content

Commit 09e0955

Browse files
authored
Reducing wait interval for BQ integration tests (#1827)
* For tests, reducing BQ's wait time. Some quick logging indicated that the uploading of the entity_df in integration tests was very slow Signed-off-by: Danny Chiao <danny@tecton.ai> * Moving environment variables into yml and MakeFile Signed-off-by: Danny Chiao <danny@tecton.ai> * Reducing prod retry cadence Signed-off-by: Danny Chiao <danny@tecton.ai>
1 parent 027247d commit 09e0955

4 files changed

Lines changed: 10 additions & 4 deletions

File tree

.github/workflows/integration_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
- name: Install dependencies
5353
run: make install-python-ci-dependencies
5454
- name: Test python
55-
run: FEAST_USAGE=False pytest -n 8 --cov=./ --cov-report=xml --verbose --color=yes sdk/python/tests --integration
55+
run: FEAST_USAGE=False IS_TEST=True pytest -n 8 --cov=./ --cov-report=xml --verbose --color=yes sdk/python/tests --integration
5656
- name: Upload coverage to Codecov
5757
uses: codecov/codecov-action@v1
5858
with:

.github/workflows/pr_integration_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
- name: Install dependencies
6464
run: make install-python-ci-dependencies
6565
- name: Test python
66-
run: FEAST_USAGE=False pytest -n 8 --cov=./ --cov-report=xml --verbose --color=yes sdk/python/tests --integration
66+
run: FEAST_USAGE=False IS_TEST=True pytest -n 8 --cov=./ --cov-report=xml --verbose --color=yes sdk/python/tests --integration
6767
- name: Upload coverage to Codecov
6868
uses: codecov/codecov-action@v1
6969
with:

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ test-python:
5656
FEAST_USAGE=False pytest -n 8 sdk/python/tests
5757

5858
test-python-integration:
59-
FEAST_USAGE=False pytest -n 8 --integration sdk/python/tests
59+
FEAST_USAGE=False IS_TEST=True pytest -n 8 --integration sdk/python/tests
6060

6161
format-python:
6262
# Sort

sdk/python/feast/infra/offline_stores/bigquery.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
import uuid
23
from datetime import date, datetime, timedelta
34
from typing import Dict, List, Optional, Union
@@ -239,7 +240,7 @@ def block_until_done(
239240
client: Client,
240241
bq_job: Union[bigquery.job.query.QueryJob, bigquery.job.load.LoadJob],
241242
timeout: int = 1800,
242-
retry_cadence: int = 10,
243+
retry_cadence: float = 1,
243244
):
244245
"""
245246
Waits for bq_job to finish running, up to a maximum amount of time specified by the timeout parameter (defaulting to 30 minutes).
@@ -255,6 +256,11 @@ def block_until_done(
255256
BigQueryJobCancelled exception to signify when that the job has been cancelled (i.e. from timeout or KeyboardInterrupt).
256257
"""
257258

259+
# For test environments, retry more aggressively
260+
is_test = os.getenv("IS_TEST", default="False") == "True"
261+
if is_test:
262+
retry_cadence = 0.1
263+
258264
def _wait_until_done(job_id):
259265
if client.get_job(job_id).state in ["PENDING", "RUNNING"]:
260266
raise BigQueryJobStillRunning(job_id=job_id)

0 commit comments

Comments
 (0)