Skip to content

Commit

Permalink
fix: allow retries of metadatata operations in system tests (#1568)
Browse files Browse the repository at this point in the history
* fix: allow retries of metadatata operations in system tests

* linter fix
  • Loading branch information
ddelgrosso1 committed Aug 26, 2021
1 parent 653f4b4 commit 9398566
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions system-test/storage.ts
Expand Up @@ -90,6 +90,7 @@ interface ErrorCallbackFunction {
}
import {PubSub} from '@google-cloud/pubsub';
import {LifecycleRule} from '../src/bucket';
import {IdempotencyStrategy} from '../src/storage';

// When set to true, skips all tests that is not compatible for
// running inside VPCSC.
Expand All @@ -106,7 +107,9 @@ describe('storage', () => {
const TESTS_PREFIX = `storage-tests-${shortUUID()}-`;
const RETENTION_DURATION_SECONDS = 10;

const storage = new Storage();
const storage = new Storage({
retryOptions: {idempotencyStrategy: IdempotencyStrategy.RetryAlways},
});
const bucket = storage.bucket(generateName());

const pubsub = new PubSub({
Expand Down Expand Up @@ -188,7 +191,9 @@ describe('storage', () => {

// eslint-disable-next-line @typescript-eslint/no-var-requires
const {Storage} = require('../src');
storageWithoutAuth = new Storage();
storageWithoutAuth = new Storage({
retryOptions: {idempotencyStrategy: IdempotencyStrategy.RetryAlways},
});
});

after(() => {
Expand Down Expand Up @@ -1737,6 +1742,9 @@ describe('storage', () => {
const storageNonAllowList = new Storage({
projectId: process.env.GCN_STORAGE_2ND_PROJECT_ID,
keyFilename: process.env.GCN_STORAGE_2ND_PROJECT_KEY,
retryOptions: {
idempotencyStrategy: IdempotencyStrategy.RetryAlways,
},
});
// the source bucket, which will have requesterPays enabled.
let bucket: Bucket;
Expand Down

0 comments on commit 9398566

Please sign in to comment.