Skip to content

Commit a26f7eb

Browse files
committed
chore(bigquery): fix timeout flakiness in job tests
1 parent 6702c7a commit a26f7eb

2 files changed

Lines changed: 5 additions & 8 deletions

File tree

packages/google-cloud-bigquery/tests/unit/job/test_async_job_retry.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@
1515
from unittest import mock
1616

1717
import google.api_core.retry
18+
import google.cloud.bigquery.job
1819
from google.api_core import exceptions
1920

2021
from . import helpers
21-
import google.cloud.bigquery.job
22-
2322

2423
PROJECT = "test-project"
2524
JOB_ID = "test-job-id"
@@ -110,7 +109,7 @@ def test_result_w_retry_wo_state(global_time_lock):
110109
predicate=custom_predicate,
111110
initial=0.001,
112111
maximum=0.001,
113-
deadline=0.1,
112+
deadline=1.0,
114113
)
115114
assert job.result(retry=custom_retry) is job
116115

packages/google-cloud-bigquery/tests/unit/job/test_query_job_retry.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,13 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14+
import concurrent.futures
1415
from unittest import mock
1516

16-
import concurrent.futures
1717
import freezegun
18-
from google.api_core import exceptions
1918
import google.api_core.retry
2019
import pytest
21-
20+
from google.api_core import exceptions
2221
from google.cloud.bigquery.client import _MIN_GET_QUERY_RESULTS_TIMEOUT
2322
from google.cloud.bigquery.job import QueryJob
2423
from google.cloud.bigquery.retry import DEFAULT_GET_JOB_TIMEOUT
@@ -27,7 +26,6 @@
2726
from ..helpers import make_connection
2827
from .helpers import _make_client
2928

30-
3129
PROJECT = "test-project"
3230
JOB_ID = "test-job-id"
3331
QUERY = "select count(*) from persons"
@@ -105,7 +103,7 @@ def test_result_w_custom_retry(global_time_lock):
105103
initial=0.001,
106104
maximum=0.001,
107105
multiplier=1.0,
108-
deadline=0.1,
106+
deadline=1.0,
109107
predicate=custom_predicate,
110108
)
111109

0 commit comments

Comments
 (0)