We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent db63aee commit 0404a33Copy full SHA for 0404a33
tests/system/_helpers.py
@@ -71,9 +71,20 @@ def _has_all_ddl(database):
71
retry_has_all_dll = retry.RetryInstanceState(_has_all_ddl)
72
73
74
+def scrub_referencing_databases(to_scrub, db_list):
75
+ for db_name in db_list:
76
+ db = to_scrub.database(db_name.split("/")[-1])
77
+ try:
78
+ retry_429_503(db.delete)()
79
+ except exceptions.NotFound: # lost the race
80
+ pass
81
+
82
83
def scrub_instance_backups(to_scrub):
84
try:
85
for backup_pb in to_scrub.list_backups():
86
+ # Backup cannot be deleted while referencing databases exist.
87
+ scrub_referencing_databases(to_scrub, backup_pb.referencing_databases)
88
bkp = instance_mod.Backup.from_pb(backup_pb, to_scrub)
89
90
# Instance cannot be deleted while backups exist.
0 commit comments