Skip to content

Commit

Permalink
Better naming and logging to investigate leaking bigtable resources (a…
Browse files Browse the repository at this point in the history
  • Loading branch information
Abacn authored Oct 31, 2023
1 parent 9a83620 commit 714badb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sdks/python/apache_beam/io/gcp/bigtableio_it_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def tearDown(self):
self.table.delete()
self.instance.delete()
except HttpError:
_LOGGER.debug(
_LOGGER.warning(
"Failed to clean up table [%s] and instance [%s]",
self.table.table_id,
self.instance.instance_id)
Expand Down Expand Up @@ -160,8 +160,8 @@ def setUpClass(cls):
cls.args = cls.test_pipeline.get_full_options_as_args()
cls.expansion_service = ('localhost:%s' % os.environ.get('EXPANSION_PORT'))

instance_id = '%s-%s-%s' % (
cls.INSTANCE, str(int(time.time())), secrets.token_hex(3))
timestr = "".join(filter(str.isdigit, str(datetime.datetime.utcnow())))
instance_id = '%s-%s-%s' % (cls.INSTANCE, timestr, secrets.token_hex(3))

cls.client = client.Client(admin=True, project=cls.project)
# create cluster and instance
Expand Down Expand Up @@ -190,15 +190,15 @@ def tearDown(self):
_LOGGER.info("Deleting table [%s]", self.table.table_id)
self.table.delete()
except HttpError:
_LOGGER.debug("Failed to clean up table [%s]", self.table.table_id)
_LOGGER.warning("Failed to clean up table [%s]", self.table.table_id)

@classmethod
def tearDownClass(cls):
try:
_LOGGER.info("Deleting instance [%s]", cls.instance.instance_id)
cls.instance.delete()
except HttpError:
_LOGGER.debug(
_LOGGER.warning(
"Failed to clean up instance [%s]", cls.instance.instance_id)

def run_pipeline(self, rows):
Expand Down

0 comments on commit 714badb

Please sign in to comment.