Skip to content

Commit b4db276

Browse files
authored
test: Add retries to increase reliability of test (#1319)
* Skip a flakey test This test needs to be skipped as it is causing P1 issues to appear. We need a formal plan for reproducing this issue. * Remove block of code for skipped test This block of code is an after hook that will not work anymore now that the test is skipped because the test creates an instance and the after hook tries to delete it * Add retry options Add retry options to create table to ensure that there is enough time for the instance to get created in order to avoid flakey tests
1 parent 63456cd commit b4db276

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

system-test/read-rows.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {describe, it, afterEach, beforeEach} from 'mocha';
2323
import * as sinon from 'sinon';
2424
import {EventEmitter} from 'events';
2525
import {Test} from './testTypes';
26-
import {ServiceError, GrpcClient, GoogleError} from 'google-gax';
26+
import {ServiceError, GrpcClient, GoogleError, CallOptions} from 'google-gax';
2727
import {PassThrough} from 'stream';
2828

2929
const {grpc} = new GrpcClient();
@@ -96,7 +96,15 @@ describe('Bigtable/Table', () => {
9696
},
9797
});
9898
await operation.promise();
99-
await table.create({});
99+
const gaxOptions: CallOptions = {
100+
retry: {
101+
retryCodes: [grpc.status.DEADLINE_EXCEEDED, grpc.status.NOT_FOUND],
102+
},
103+
maxRetries: 10,
104+
};
105+
await table.create({
106+
gaxOptions,
107+
});
100108
await table.getRows(); // This is done to initialize the data client
101109
await bigtable.close();
102110
try {

0 commit comments

Comments
 (0)