Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(bigtable): Clean up test clusters #9270

Merged
merged 4 commits into from
Jan 23, 2024
Merged

Conversation

bhshkh
Copy link
Contributor

@bhshkh bhshkh commented Jan 17, 2024

Issue: Test fails with error:

=== RUN   TestIntegration_AdminCopyBackup
    integration_test.go:3099: CreateCluster: rpc error: code = FailedPrecondition desc = Cannot create multiple clusters in the same zone.

Cause:
Cluster created in previous run did not get cleaned up

Fix:

  • Create clusters and instances with proper prefix
  • Retry cleanup post tests run

@bhshkh bhshkh requested review from a team as code owners January 17, 2024 17:59
@product-auto-label product-auto-label bot added size: s Pull request size is small. api: bigtable Issues related to the Bigtable API. labels Jan 17, 2024
@bhshkh bhshkh linked an issue Jan 17, 2024 that may be closed by this pull request
Copy link
Contributor

@kolea2 kolea2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm with one question

}
} else {
// Delete clusters created in existing instances
clusters, err := iac.Clusters(ctx, instanceInfo.Name)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to confirm, is there ever a case where we want to keep the instance and cluster?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want to keep the ones created by the integration test.

The ones created by user will not be deleted.
User can specify an existing instance and a existing cluster to use in tests via environment variables:
GCLOUD_TESTS_BIGTABLE_INSTANCE
GCLOUD_TESTS_BIGTABLE_CLUSTER

There are prefix checks at line 137 and 154 to determine whether resource was created by the test

@bhshkh bhshkh enabled auto-merge (squash) January 23, 2024 23:25
@bhshkh bhshkh merged commit 3213b45 into googleapis:main Jan 23, 2024
9 of 12 checks passed
@bhshkh bhshkh deleted the test/issue-9258 branch January 23, 2024 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigtable Issues related to the Bigtable API. size: s Pull request size is small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bigtable: TestIntegration_AdminCopyBackup failed
3 participants