Skip to content

Commit 7fe1e2b

Browse files
bcoeNimJay
authored andcommitted
test: quickstart sometimes has service failures (#369)
1 parent 4c9c5a7 commit 7fe1e2b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

dataproc/system-test/quickstart.test.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
'use strict';
1616

1717
const {assert} = require('chai');
18-
const {describe, it, before, after} = require('mocha');
18+
const {describe, it, beforeEach, afterEach} = require('mocha');
1919
const cp = require('child_process');
2020
const {v4} = require('uuid');
2121

@@ -46,13 +46,17 @@ const execSync = cmd =>
4646
encoding: 'utf-8',
4747
});
4848

49+
const {delay} = require('./util');
50+
4951
describe('execute the quickstart', () => {
50-
before(async () => {
52+
beforeEach(async () => {
5153
const [bucket] = await storage.createBucket(bucketName);
5254
await bucket.file(jobFileName).save(sortCode);
5355
});
5456

55-
it('should execute the quickstart', async () => {
57+
it('should execute the quickstart', async function () {
58+
this.retries(4);
59+
await delay(this.test);
5660
const stdout = execSync(
5761
`node quickstart.js "${projectId}" "${region}" "${clusterName}" "${jobFilePath}"`
5862
);
@@ -62,7 +66,7 @@ describe('execute the quickstart', () => {
6266
assert.match(stdout, /successfully deleted/);
6367
});
6468

65-
after(async () => {
69+
afterEach(async () => {
6670
await storage.bucket(bucketName).file(jobFileName).delete();
6771
await storage.bucket(bucketName).delete();
6872

0 commit comments

Comments
 (0)