Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Commit eed9dc2

Browse files
committed
chore: merge remote-tracking branch 'remotes/origin/conformance-fixes' into conformance-fixes-2
2 parents 65a75f5 + b967d5a commit eed9dc2

3 files changed

Lines changed: 20 additions & 12 deletions

File tree

testproxy/services/close-client.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
import {google} from '../protos/protos';
1616
import {ClientImplMaker, normalizeCallback} from './utils';
17-
import {deleteBigtableClient} from './utils/bigtable-client';
1817
type ICloseClientRequest = google.bigtable.testproxy.ICloseClientRequest;
1918
type ICloseClientResponse = google.bigtable.testproxy.ICloseClientResponse;
2019

@@ -28,7 +27,7 @@ export const closeClient: ClientImplMaker<
2827
const bigtable = clientMap.get(clientId!);
2928

3029
if (bigtable) {
31-
await deleteBigtableClient(bigtable);
30+
await bigtable.close();
3231
}
3332
return {};
3433
});

testproxy/services/read-rows.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,12 @@ export const readRows: ClientImplMaker<IReadRowsRequest, IRowsResult> = ({
8686
} catch (e) {
8787
const error = e as GoogleError;
8888
return {
89-
code: error.code,
90-
// e.details must be in an empty array for the test runner to return the status. This is tracked in b/383096533.
91-
details: [],
92-
message: error.message,
89+
status: {
90+
code: error.code,
91+
// e.details must be in an empty array for the test runner to return the status. This is tracked in b/383096533.
92+
details: [],
93+
message: error.message,
94+
},
9395
};
9496
}
9597
});

testproxy/services/utils/bigtable-client.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
import * as grpc from '@grpc/grpc-js';
1516
import {Bigtable} from '../../../src';
1617
import {ClientSideMetricsConfigManager} from '../../../src/client-side-metrics/metrics-config-manager';
1718
import {IMetricsHandler} from '../../../src/client-side-metrics/metrics-handler';
@@ -23,10 +24,17 @@ export function createBigtableClient(bigtable: Bigtable) {
2324
const handlers: IMetricsHandler[] = [];
2425
bigtable._metricsConfigManager = new ClientSideMetricsConfigManager(handlers);
2526

27+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
28+
const bigtableAny = bigtable as any;
29+
2630
// We'll store these in the Bigtable object so that we can access them from the
2731
// test proxy.
28-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
29-
(bigtable as any)[v2] = new BigtableClient(bigtable.options.BigtableClient);
32+
if (bigtableAny[v2]) {
33+
throw Object.assign(new Error('should not have a BigtableClient already'), {
34+
code: grpc.status.ALREADY_EXISTS,
35+
});
36+
}
37+
bigtableAny[v2] = new BigtableClient(bigtable.options.BigtableClient);
3038
}
3139

3240
export function getBigtableClient(bigtable: Bigtable) {
@@ -39,8 +47,7 @@ export async function deleteBigtableClient(bigtable: Bigtable) {
3947
const bigtableAny = bigtable as any;
4048

4149
const bigtableClient = bigtableAny[v2];
42-
if (bigtableClient) {
43-
await bigtableClient.close();
44-
delete bigtableAny[v2];
45-
}
50+
await bigtableClient.close();
51+
52+
delete bigtableAny[v2];
4653
}

0 commit comments

Comments
 (0)