googleapis / nodejs-pubsub

Node.js client for Google Cloud Pub/Sub: Ingest event streams from anywhere, at any scale, for simple, reliable, real-time stream analytics.
https://cloud.google.com/pubsub/
Apache License 2.0
516 stars 227 forks source link

SchemaServiceClient close doesn't wait dependencies promises #1911

Closed thomasvargiu closed 2 months ago

thomasvargiu commented 2 months ago

Hi, The SchemaServiceClient doesn't wait iamClient to be closed.

See https://github.com/googleapis/nodejs-pubsub/blob/aba9aee0c8ecc840c150aa077892b7bb88f18eca/src/v1/schema_service_client.ts#L1819-L1820

Running some integration tests Jest returns the following error:

Jest did not exit one second after the test run has completed.

'This usually means that there are asynchronous operations that weren't stopped in your tests. Consider running Jest with `--detectOpenHandles` to troubleshoot this issue.

Usually it's not a real problem, but I think it should be better to wait all close operations.

hongalex commented 2 months ago

That part of the client is generated code and is not specific to Pub/Sub. To get this change made, please file this issue under gapic-generator-typescript.

For reference, this change was added in this PR: https://github.com/googleapis/gapic-generator-typescript/pull/953