1515'use strict' ;
1616
1717const { assert} = require ( 'chai' ) ;
18- const { describe, it, before , after } = require ( 'mocha' ) ;
18+ const { describe, it, beforeEach , afterEach } = require ( 'mocha' ) ;
1919const cp = require ( 'child_process' ) ;
2020const { v4} = require ( 'uuid' ) ;
2121
@@ -46,13 +46,17 @@ const execSync = cmd =>
4646 encoding : 'utf-8' ,
4747 } ) ;
4848
49+ const { delay} = require ( './util' ) ;
50+
4951describe ( '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 , / s u c c e s s f u l l y d e l e t e d / ) ;
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