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

feat(pubsub): add clear export subscription samples #3159

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

hongalex
Copy link
Collaborator

@hongalex hongalex commented Jun 2, 2023

This PR corresponds to the changes in googleapis/google-cloud-go#8040. We currently were not catching an issue where clearing bigquery subscription fails. This adds the appropriate sample + test to catch this. A similar sample and test is added for Push (to endpoint) subscriptions.

This PR also switches the BQ dataset/table used from dynamically created to a reused one. Since we aren't actually writing to these tables, there's no harm in reusing a predefined table. This prevents a slow leakage of tables/datasets over time when tests invocations inevitably fail.

@hongalex hongalex requested review from a team as code owners June 2, 2023 22:26
@snippet-bot
Copy link

snippet-bot bot commented Jun 2, 2023

Here is the summary of changes.

You are about to add 2 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@product-auto-label product-auto-label bot added api: pubsub Issues related to the Pub/Sub API. samples Issues that are directly related to samples. labels Jun 2, 2023
@hongalex hongalex changed the title feat(pubsub): add clear bq subscription sample feat(pubsub): add clear export subscription samples Jun 2, 2023
Copy link
Contributor

@telpirion telpirion left a comment

Choose a reason for hiding this comment

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

Only nits. Feel free to merge when status is green.


pushSubID := subID + "-push"
testutil.Retry(t, 10, time.Second, func(r *testutil.R) {
buf := new(bytes.Buffer)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I prefer to declare & initialize a buffer like so:

var buf bytes.Buffer

if err != nil {
r.Errorf("CreateTopic: %v", err)
}
buf := new(bytes.Buffer)
Copy link
Contributor

Choose a reason for hiding this comment

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

See previous about declaring & initializing a buffer.

})

testutil.Retry(t, 10, time.Second, func(r *testutil.R) {
buf := new(bytes.Buffer)
Copy link
Contributor

Choose a reason for hiding this comment

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

See previous about declaring & initializing a buffer.

@telpirion telpirion self-assigned this Jun 8, 2023
@meredithslota meredithslota assigned hongalex and unassigned telpirion Oct 12, 2023
@muncus
Copy link
Collaborator

muncus commented Nov 13, 2023

Hi @hongalex,

This PR looks to be pretty stale, and need some attention to get the tests passing. I'll move it to Draft for now, but please reach out if you need any help getting this PR merged.

@muncus muncus marked this pull request as draft November 13, 2023 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsub Issues related to the Pub/Sub API. samples Issues that are directly related to samples.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants