File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,11 +35,26 @@ const execSync = cmd =>
3535 } ) ;
3636
3737describe ( 'create a dataproc cluster' , ( ) => {
38- it ( 'should create a dataproc cluster' , async ( ) => {
39- const stdout = execSync (
40- `node createCluster.js "${ projectId } " "${ region } " "${ clusterName } "`
41- ) ;
42- assert . match ( stdout , new RegExp ( `${ clusterName } ` ) ) ;
38+ it ( 'should create a dataproc cluster' , async function ( ) {
39+ try {
40+ const stdout = execSync (
41+ `node createCluster.js "${ projectId } " "${ region } " "${ clusterName } "`
42+ ) ;
43+ assert . match ( stdout , new RegExp ( `${ clusterName } ` ) ) ;
44+ } catch ( err ) {
45+ if (
46+ err ?. message ?. includes ( 'QUOTA' ) ||
47+ err ?. message ?. includes ( 'RESOURCE_EXHAUSTED' ) ||
48+ err ?. message ?. includes ( 'DISKS_TOTAL_GB' )
49+ ) {
50+ console . warn (
51+ `Quota limit reached in project ${ projectId } . Skipping test.`
52+ ) ;
53+ this . skip ( ) ;
54+ } else {
55+ throw err ;
56+ }
57+ }
4358 } ) ;
4459
4560 after ( async ( ) => {
Original file line number Diff line number Diff line change @@ -30,11 +30,26 @@ const {delay} = require('./util');
3030
3131describe ( 'instantiate an inline workflow template' , ( ) => {
3232 it ( 'should instantiate an inline workflow template' , async function ( ) {
33- this . retries ( 4 ) ;
34- await delay ( this . test ) ;
35- const stdout = execSync (
36- `node instantiateInlineWorkflowTemplate.js "${ projectId } " "${ region } "`
37- ) ;
38- assert . match ( stdout , / s u c c e s s f u l l y / ) ;
33+ try {
34+ this . retries ( 4 ) ;
35+ await delay ( this . test ) ;
36+ const stdout = execSync (
37+ `node instantiateInlineWorkflowTemplate.js "${ projectId } " "${ region } "`
38+ ) ;
39+ assert . match ( stdout , / s u c c e s s f u l l y / ) ;
40+ } catch ( err ) {
41+ if (
42+ err ?. message ?. includes ( 'QUOTA' ) ||
43+ err ?. message ?. includes ( 'RESOURCE_EXHAUSTED' ) ||
44+ err ?. message ?. includes ( 'DISKS_TOTAL_GB' )
45+ ) {
46+ console . warn (
47+ `Quota limit reached in project ${ projectId } . Skipping test.`
48+ ) ;
49+ this . skip ( ) ;
50+ } else {
51+ throw err ;
52+ }
53+ }
3954 } ) ;
4055} ) ;
Original file line number Diff line number Diff line change @@ -51,9 +51,24 @@ const execSync = cmd =>
5151 } ) ;
5252
5353describe ( 'submit a Spark job to a Dataproc cluster' , ( ) => {
54- before ( async ( ) => {
55- const [ operation ] = await clusterClient . createCluster ( cluster ) ;
56- await operation . promise ( ) ;
54+ before ( async function ( ) {
55+ try {
56+ const [ operation ] = await clusterClient . createCluster ( cluster ) ;
57+ await operation . promise ( ) ;
58+ } catch ( err ) {
59+ if (
60+ err ?. message ?. includes ( 'QUOTA' ) ||
61+ err ?. message ?. includes ( 'RESOURCE_EXHAUSTED' ) ||
62+ err ?. message ?. includes ( 'DISKS_TOTAL_GB' )
63+ ) {
64+ console . warn (
65+ `Quota limit reached in project ${ projectId } . Skipping test.`
66+ ) ;
67+ this . skip ( ) ;
68+ } else {
69+ throw err ;
70+ }
71+ }
5772 } ) ;
5873
5974 it ( 'should submit a job to a dataproc cluster' , async ( ) => {
You can’t perform that action at this time.
0 commit comments