Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

Commit ebe730a

Browse files
committed
Fixed async system tests
1 parent 68ad87d commit ebe730a

11 files changed

Lines changed: 471 additions & 318 deletions

File tree

google/cloud/bigtable/admin_v2/overlay/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
# client class under overlay/services.
3131

3232
from .types import (
33+
AsyncRestoreTableOperation,
3334
RestoreTableOperation,
3435
WaitForConsistencyRequest,
3536
)
@@ -40,6 +41,7 @@
4041
)
4142

4243
__all__ = (
44+
"AsyncRestoreTableOperation",
4345
"RestoreTableOperation",
4446
"BigtableTableAdminAsyncClient",
4547
"BigtableTableAdminClient",

google/cloud/bigtable/admin_v2/overlay/types/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from .async_restore_table import (
16+
AsyncRestoreTableOperation,
17+
)
18+
1519
from .restore_table import (
1620
RestoreTableOperation,
1721
)
@@ -21,6 +25,7 @@
2125
)
2226

2327
__all__ = (
28+
"AsyncRestoreTableOperation",
2429
"RestoreTableOperation",
2530
"WaitForConsistencyRequest",
2631
)

google/cloud/bigtable/admin_v2/overlay/types/async_consistency.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
OptionalRetry = Union[retries.Retry, object, None] # type: ignore
2626

2727

28+
# The consistency check could take a very long time, so we wait indefinitely.
29+
DEFAULT_RETRY = async_future.DEFAULT_RETRY.with_timeout(None)
30+
31+
2832
class _AsyncCheckConsistencyPollingFuture(async_future.AsyncFuture):
2933
"""A Future that polls an underlying `check_consistency` operation until it returns True.
3034
@@ -48,7 +52,7 @@ class _AsyncCheckConsistencyPollingFuture(async_future.AsyncFuture):
4852
<google.cloud.bigtable.admin_v2.overlay.services.bigtable_table_admin.BigtableTableAdminClient.wait_for_consistency>`
4953
or :meth:`wait_for_replication
5054
<google.cloud.bigtable.admin_v2.overlay.services.bigtable_table_admin.BigtableTableAdminClient.wait_for_replication>`
51-
retry (google.api_core.retry.Retry): The retry configuration used
55+
retry (google.api_core.retry.AsyncRetry): The retry configuration used
5256
when polling. This can be used to control how often :meth:`done`
5357
is polled. Regardless of the retry's ``deadline``, it will be
5458
overridden by the ``timeout`` argument to :meth:`result`.
@@ -59,7 +63,7 @@ def __init__(
5963
check_consistency_call: Callable[
6064
[OptionalRetry], Awaitable[bigtable_table_admin.CheckConsistencyResponse]
6165
],
62-
retry: retries.Retry = async_future.DEFAULT_RETRY,
66+
retry: retries.AsyncRetry = DEFAULT_RETRY,
6367
**kwargs
6468
):
6569
super(_AsyncCheckConsistencyPollingFuture, self).__init__(retry=retry, **kwargs)

google/cloud/bigtable/admin_v2/overlay/types/consistency.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
OptionalRetry = Union[retries.Retry, object, None] # type: ignore
2626

2727

28+
# The consistency check could take a very long time, so we wait indefinitely.
29+
DEFAULT_RETRY = polling.DEFAULT_POLLING.with_timeout(None)
30+
31+
2832
class _CheckConsistencyPollingFuture(polling.PollingFuture):
2933
"""A Future that polls an underlying `check_consistency` operation until it returns True.
3034
@@ -55,7 +59,7 @@ def __init__(
5559
check_consistency_call: Callable[
5660
[OptionalRetry], bigtable_table_admin.CheckConsistencyResponse
5761
],
58-
polling: retries.Retry = polling.DEFAULT_POLLING,
62+
polling: retries.Retry = DEFAULT_RETRY,
5963
**kwargs
6064
):
6165
super(_CheckConsistencyPollingFuture, self).__init__(polling=polling, **kwargs)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
# 'Development Status :: 5 - Production/Stable'
3838
release_status = "Development Status :: 5 - Production/Stable"
3939
dependencies = [
40-
"google-api-core[grpc] >= 2.16.0, <3.0.0",
40+
"google-api-core[grpc] >= 2.17.0, <3.0.0",
4141
"google-cloud-core >= 1.4.4, <3.0.0",
4242
"google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0",
4343
"grpc-google-iam-v1 >= 0.12.4, <1.0.0",

testing/constraints-3.7.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#
66
# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev",
77
# Then this file should have foo==1.14.0
8-
google-api-core==2.16.0
8+
google-api-core==2.17.0
99
google-auth==2.14.1
1010
google-cloud-core==2.0.0
1111
grpc-google-iam-v1==0.12.4

testing/constraints-3.8.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#
66
# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev",
77
# Then this file should have foo==1.14.0
8-
google-api-core==2.16.0
8+
google-api-core==2.17.0
99
google-auth==2.14.1
1010
google-cloud-core==2.0.0
1111
grpc-google-iam-v1==0.12.4

tests/system/admin_overlay/conftest.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,8 @@
77
BACKUP_PREFIX = "admin-overlay-backup"
88
ROW_PREFIX = "test-row"
99

10-
DEFAULT_CLUSTER_LOCATIONS = [
11-
"us-east1-b"
12-
]
13-
REPLICATION_CLUSTER_LOCATIONS = [
14-
"us-east1-b",
15-
"us-west1-b"
16-
]
10+
DEFAULT_CLUSTER_LOCATIONS = ["us-east1-b"]
11+
REPLICATION_CLUSTER_LOCATIONS = ["us-east1-b", "us-west1-b"]
1712
TEST_TABLE_NAME = "system-test-table"
1813
TEST_BACKUP_TABLE_NAME = "system-test-backup-table"
1914
TEST_COLUMMN_FAMILY_NAME = "test-column"
@@ -28,4 +23,4 @@ def admin_overlay_project_id():
2823
# Instantiate a meaningless client to get project name
2924
# from environment variables.
3025
client = ClientWithProject()
31-
return client.project
26+
yield client.project

tests/system/admin_overlay/test_system.py

Lines changed: 0 additions & 239 deletions
This file was deleted.

0 commit comments

Comments
 (0)