cloudpubsub: apply ReceiveSettings to Subscription - #40
Open
fohte wants to merge 3 commits into
Open
Conversation
intent(cloudpubsub): make WithReceiveSettings actually take effect, since CreateSubscriber built the pubsub.Subscription but never copied Config.ReceiveSettings onto it, so Receive always ran with the library's zero-value/default settings regardless of the option learned(cloudpubsub): a zero pubsub.ReceiveSettings is equivalent to DefaultReceiveSettings (cloud.google.com/go/pubsub falls back per-field in Subscription.Receive), so assigning cfg.ReceiveSettings is a no-op for callers who never set the option
intent(cloudpubsub): replace the white-box regression test with a black-box one that drives the public Subscriber interface, per the project's protective test guideline of testing only through the public API learned(cloudpubsub): the client's flow controller enforces MaxOutstandingMessages by blocking delivery of the next message until an in-flight one is acked, independent of NumGoroutines/Synchronous, so capping it at 1 gives a deterministic (non-flaky) way to observe whether the setting reached the Subscription decision(cloudpubsub): extract the pstest/gRPC/client setup shared by both tests into a newTestEnv helper instead of duplicating it, since the two tests now differ only in the options passed to CreateSubscriber
intent(cloudpubsub): keep only the non-obvious fact (flow control bounds concurrency independent of NumGoroutines) instead of restating what the test name and body already say
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
pubsub.ReceiveSettingspassed tocloudpubsub.WithReceiveSettingsnever reached the actual subscription, so it always ran with the library's default settingsWhat
ReceiveSettingsto thepubsub.Subscriptioncreated byCreateSubscriber