Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Try eliminating generated close client #1526

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/tabular-api-surface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import {ChunkTransformer} from './chunktransformer';
import {BackoffSettings} from 'google-gax/build/src/gax';
import {google} from '../protos/protos';
import {CallOptions, ServiceError} from 'google-gax';
import {CallOptions, grpc, ServiceError} from 'google-gax';
import {Duplex, PassThrough, Transform} from 'stream';
import * as is from 'is';
import {GoogleInnerError} from './table';
Expand Down Expand Up @@ -325,7 +325,7 @@
// Handling retries in this client. Specify the retry options to
// make sure nothing is retried in retry-request.
noResponseRetries: 0,
shouldRetryFn: (_: any) => {

Check warning on line 328 in src/tabular-api-surface.ts

View workflow job for this annotation

GitHub Actions / lint

'_' is defined but never used

Check warning on line 328 in src/tabular-api-surface.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
return false;
},
};
Expand Down Expand Up @@ -480,10 +480,23 @@
);
retryTimer = setTimeout(makeNewRequest, nextRetryDelay);
} else {
if (
!error.code &&
error.message === 'The client has already been closed.'
) {
//
// The TestReadRows_Generic_CloseClient conformance test requires
// a grpc code to be present when the client is closed. According
// to Gemini, the appropriate code for a closed client is
// CANCELLED since the user actually cancelled the call by closing
// the client.
//
error.code = grpc.status.CANCELLED;
}
userStream.emit('error', error);
}
})
.on('data', _ => {

Check warning on line 499 in src/tabular-api-surface.ts

View workflow job for this annotation

GitHub Actions / lint

'_' is defined but never used
// Reset error count after a successful read so the backoff
// time won't keep increasing when as stream had multiple errors
numConsecutiveErrors = 0;
Expand Down Expand Up @@ -706,7 +719,7 @@
// Handling retries in this client. Specify the retry options to
// make sure nothing is retried in retry-request.
noResponseRetries: 0,
shouldRetryFn: (_: any) => {

Check warning on line 722 in src/tabular-api-surface.ts

View workflow job for this annotation

GitHub Actions / lint

'_' is defined but never used
return false;
},
};
Expand Down
2 changes: 1 addition & 1 deletion testproxy/services/close-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

const normalizeCallback = require('./utils/normalize-callback.js');

const v2 = Symbol.for('v2');

Check failure on line 18 in testproxy/services/close-client.js

View workflow job for this annotation

GitHub Actions / lint

'v2' is assigned a value but never used

const closeClient = ({clientMap}) =>
normalizeCallback(async rawRequest => {
Expand All @@ -24,7 +24,7 @@
const bigtable = clientMap.get(clientId);

if (bigtable) {
await bigtable[v2].close();
// await bigtable[v2].close();
await bigtable.close();
return {};
}
Expand Down
Loading