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

Commit 2932a02

Browse files
authored
fix: delete stale instance with delay of 5 seconds (#194)
1 parent 029b181 commit 2932a02

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

create_test_database.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
USE_EMULATOR = os.getenv("SPANNER_EMULATOR_HOST") is not None
2828

2929
PROJECT = os.getenv(
30-
"GOOGLE_CLOUD_PROJECT", os.getenv("PROJECT_ID", "emulator-test-project"),
30+
"GOOGLE_CLOUD_PROJECT",
31+
os.getenv("PROJECT_ID", "emulator-test-project"),
3132
)
3233
CLIENT = None
3334

@@ -56,6 +57,7 @@ def delete_stale_test_instances():
5657
# therefore instance can just be deleted.
5758
try:
5859
instance.delete()
60+
time.sleep(5) # Sleep for 5 seconds to give time for cooldown.
5961
except ResourceExhausted:
6062
print(
6163
"Unable to drop stale instance '{}'. May need manual delete.".format(

0 commit comments

Comments
 (0)