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

Commit 96533f3

Browse files
authored
test: Better factoring and generate instance id for close test (#1675)
## Description Every once in a while the close client test acts up. It says the instance has already been created. This PR may fix this flakey test and if not at the very least it will make sure two running system tests don't interfere with one another. ## Impact Less Flakey tests ## Testing Test changed to be less Flakey
1 parent 8e52277 commit 96533f3

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

system-test/read-rows.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import {PassThrough} from 'stream';
2828
import * as proxyquire from 'proxyquire';
2929
import {TabularApiSurface} from '../src/tabular-api-surface';
3030
import * as mocha from 'mocha';
31+
import {generateId} from './common';
3132

3233
const {grpc} = new GrpcClient();
3334

@@ -105,13 +106,10 @@ describe('Bigtable/Table', () => {
105106
}).Bigtable;
106107

107108
const bigtable = new FakeBigtable();
108-
const INSTANCE_NAME = 'fake-instance2';
109+
const INSTANCE_NAME = generateId('instance');
109110
// eslint-disable-next-line @typescript-eslint/no-explicit-any
110111
(bigtable as any).grpcCredentials = grpc.credentials.createInsecure();
111112

112-
const INSTANCE = bigtable.instance('instance');
113-
const TABLE = INSTANCE.table('table');
114-
115113
describe('close', () => {
116114
it('should fail when invoking readRows with closed client', async () => {
117115
const instance = bigtable.instance(INSTANCE_NAME);
@@ -152,6 +150,8 @@ describe('Bigtable/Table', () => {
152150
});
153151

154152
describe('createReadStream', () => {
153+
const INSTANCE = bigtable.instance('instance');
154+
const TABLE = INSTANCE.table('table');
155155
let endCalled: boolean;
156156
let error: ServiceError | null;
157157
let requestedOptions: Array<{}>;

0 commit comments

Comments
 (0)