pstest: Topic.Delete stops subscription unnecessarily #1938
Labels
api: pubsub
Issues related to the Pub/Sub API.
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Client
pstest
Environment
Go test
Code
runnable gist
Expected behavior
The topic and sub can be deleted in that order without an error.
Actual behavior
Additional context
The bug is here:
google-cloud-go/pubsub/pstest/fake.go
Line 536 in ba65210
When a topic is stopped, its subscriptions are also stopped which closes the subscription's done channel. When the subscription is later stopped, there is no check that the done channel is already closed.
The behavior of stopping the subscription on topic delete is incorrect. See https://cloud.google.com/pubsub/docs/admin#deleting_a_topic:
The text was updated successfully, but these errors were encountered: