-
Notifications
You must be signed in to change notification settings - Fork 21
Closed
Labels
priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
Unit test for closed client fails on timeout.
it('invokes createTable with closed client', async () => {
const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({
credentials: {client_email: 'bogus', private_key: 'bogus'},
projectId: 'bogus',
});
client.initialize();
const request = generateSampleMessage(
new protos.google.bigtable.admin.v2.CreateTableRequest()
);
const expectedError = new Error('The client has already been closed.');
client.close();
await assert.rejects(client.createTable(request), expectedError);
});
In the client library, if a client has been close, it return reject promise
if (this._terminated) {
console.log('---terminated');
return Promise.reject('The client has already been closed.');
}
```
In the gax, `call.ts` call() doesn't catch this reject promise cause the hanging out.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.