fix: Integration test close function again#1103
fix: Integration test close function again#1103danieljbruce merged 12 commits intogoogleapis:mainfrom
Conversation
…into integration-test-close-function-again # Conflicts: # src/table.ts
danieljbruce
left a comment
There was a problem hiding this comment.
A comment to clarify the original problem.
| */ | ||
| promisifyAll(Bigtable, { | ||
| exclude: ['instance', 'operation', 'request'], | ||
| exclude: ['close', 'instance', 'operation', 'request'], |
There was a problem hiding this comment.
In the absence of this change, the test just seems to hang forever.
There was a problem hiding this comment.
promisifyAll turns a cb based function into a promise based function, it looks like close was already a promise, and did not expect a callback as an argument:
close(): Promise<void[]>There was a problem hiding this comment.
Yes. I am making sure the reader of this PR knows why this change is necessary.
There was a problem hiding this comment.
Thanks for clarifying why the test hangs in this PR though!
| */ | ||
| promisifyAll(Bigtable, { | ||
| exclude: ['instance', 'operation', 'request'], | ||
| exclude: ['close', 'instance', 'operation', 'request'], |
There was a problem hiding this comment.
promisifyAll turns a cb based function into a promise based function, it looks like close was already a promise, and did not expect a callback as an argument:
close(): Promise<void[]>
This fixes an issue with the close function where promises of promises were once returned, but now we simply return a promise so that when we use
awaitthen the code is executed properly.