Repository navigation
ci(bigtable): extract StaleResourceCleaner into nightly Kokoro job - #15058
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a standalone utility, StaleResourceCleaner, along with its corresponding unit tests, to handle the cleanup of stale Bigtable test resources older than 24 hours. This replaces the inline cleanup logic previously defined in TestEnvRule and is integrated into Kokoro as a nightly job. The review feedback highlights several areas in StaleResourceCleaner where exceptions (such as those caused by concurrent resource deletions) could propagate and prematurely abort the cleanup process. It is recommended to wrap these operations in broader try-catch blocks to ensure the cleanup process remains robust and continues executing even if individual resource deletions fail.
7f09a72 to
07e2242
Compare
|
The unit test error seems legit |
…eCleanerTest for JDK 8
|
fixed the test - it was a jvm / mockito bug |
Extracts stale resource cleanup out of
TestEnvRule.after()into a standaloneStaleResourceCleanerutility scheduled via a nightly Kokoro job, eliminating ~60+ redundant Admin API list scans per PR.Changes
StaleResourceCleaner: Moves stale resource cleanup (>24h oldtemp-*views, tables, authorized views, app profiles, clusters, backups, and orphaned test instances) out ofTestEnvRule.after()intoStaleResourceCleanerusingCloudEnv(AbstractTestEnv), with JUnit 5 unit tests inStaleResourceCleanerTest.TestEnvRule&pom.xml: RemovescleanUpStale()and unusedgrpcLogHandler/bigtable.grpc-log-dirfromTestEnvRule.javaandgoogle-cloud-bigtable/pom.xml, and configures anexec-maven-pluginexecution (exec:java@cleanup-stale-resources) to runStaleResourceCleaner..kokoro/nightly/bigtable-cleanup.cfgand.kokoro/bigtable-cleanup.shto runStaleResourceCleaneragainstgcloud-devel(google-cloud-bigtableandgoogle-cloud-bigtable-session).