15
15
'use strict' ;
16
16
17
17
const { assert} = require ( 'chai' ) ;
18
- const { describe, it, before , after } = require ( 'mocha' ) ;
18
+ const { describe, it, beforeEach , afterEach } = require ( 'mocha' ) ;
19
19
const cp = require ( 'child_process' ) ;
20
20
const { v4} = require ( 'uuid' ) ;
21
21
@@ -46,13 +46,17 @@ const execSync = cmd =>
46
46
encoding : 'utf-8' ,
47
47
} ) ;
48
48
49
+ const { delay} = require ( './util' ) ;
50
+
49
51
describe ( 'execute the quickstart' , ( ) => {
50
- before ( async ( ) => {
52
+ beforeEach ( async ( ) => {
51
53
const [ bucket ] = await storage . createBucket ( bucketName ) ;
52
54
await bucket . file ( jobFileName ) . save ( sortCode ) ;
53
55
} ) ;
54
56
55
- it ( 'should execute the quickstart' , async ( ) => {
57
+ it ( 'should execute the quickstart' , async function ( ) {
58
+ this . retries ( 4 ) ;
59
+ await delay ( this . test ) ;
56
60
const stdout = execSync (
57
61
`node quickstart.js "${ projectId } " "${ region } " "${ clusterName } " "${ jobFilePath } "`
58
62
) ;
@@ -62,7 +66,7 @@ describe('execute the quickstart', () => {
62
66
assert . match ( stdout , / s u c c e s s f u l l y d e l e t e d / ) ;
63
67
} ) ;
64
68
65
- after ( async ( ) => {
69
+ afterEach ( async ( ) => {
66
70
await storage . bucket ( bucketName ) . file ( jobFileName ) . delete ( ) ;
67
71
await storage . bucket ( bucketName ) . delete ( ) ;
68
72
0 commit comments