Skip to content

Commit

Permalink
test: Add retries to increase reliability of test (#1319)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
danieljbruce authored Oct 23, 2023
1 parent 63456cd commit b4db276
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions system-test/read-rows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {describe, it, afterEach, beforeEach} from 'mocha';
import * as sinon from 'sinon';
import {EventEmitter} from 'events';
import {Test} from './testTypes';
import {ServiceError, GrpcClient, GoogleError} from 'google-gax';
import {ServiceError, GrpcClient, GoogleError, CallOptions} from 'google-gax';
import {PassThrough} from 'stream';

const {grpc} = new GrpcClient();
Expand Down Expand Up @@ -96,7 +96,15 @@ describe('Bigtable/Table', () => {
},
});
await operation.promise();
await table.create({});
const gaxOptions: CallOptions = {
retry: {
retryCodes: [grpc.status.DEADLINE_EXCEEDED, grpc.status.NOT_FOUND],
},
maxRetries: 10,
};
await table.create({
gaxOptions,
});
await table.getRows(); // This is done to initialize the data client
await bigtable.close();
try {
Expand Down

0 comments on commit b4db276

Please sign in to comment.