From 7dfc2aa4b9b71d501c82e9ca92c6184f333971e6 Mon Sep 17 00:00:00 2001 From: Angel Caamal Date: Fri, 19 Jun 2026 19:51:10 +0000 Subject: [PATCH 1/3] fix(dataproc): add robust error handling for quota exhaustion --- dataproc/system-test/createCluster.test.js | 25 +++++++++++++---- .../instantiateInlineWorkflowTemplate.test.js | 27 ++++++++++++++----- dataproc/system-test/submitJob.test.js | 21 ++++++++++++--- 3 files changed, 59 insertions(+), 14 deletions(-) diff --git a/dataproc/system-test/createCluster.test.js b/dataproc/system-test/createCluster.test.js index 6d6aad852a..449c5c48e7 100644 --- a/dataproc/system-test/createCluster.test.js +++ b/dataproc/system-test/createCluster.test.js @@ -35,11 +35,26 @@ const execSync = cmd => }); describe('create a dataproc cluster', () => { - it('should create a dataproc cluster', async () => { - const stdout = execSync( - `node createCluster.js "${projectId}" "${region}" "${clusterName}"` - ); - assert.match(stdout, new RegExp(`${clusterName}`)); + it('should create a dataproc cluster', async function () { + try { + const stdout = execSync( + `node createCluster.js "${projectId}" "${region}" "${clusterName}"` + ); + assert.match(stdout, new RegExp(`${clusterName}`)); + } catch (err) { + if ( + err?.message?.includes('QUOTA') || + err?.message?.includes('RESOURCE_EXHAUSTED') || + err?.message?.includes('DISKS_TOTAL_GB') + ) { + console.warn( + `Quota limit reached in project ${projectId}. Skipping test.` + ); + this.skip(); + } else { + throw err; + } + } }); after(async () => { diff --git a/dataproc/system-test/instantiateInlineWorkflowTemplate.test.js b/dataproc/system-test/instantiateInlineWorkflowTemplate.test.js index f1669b2d50..f5541a78e4 100644 --- a/dataproc/system-test/instantiateInlineWorkflowTemplate.test.js +++ b/dataproc/system-test/instantiateInlineWorkflowTemplate.test.js @@ -30,11 +30,26 @@ const {delay} = require('./util'); describe('instantiate an inline workflow template', () => { it('should instantiate an inline workflow template', async function () { - this.retries(4); - await delay(this.test); - const stdout = execSync( - `node instantiateInlineWorkflowTemplate.js "${projectId}" "${region}"` - ); - assert.match(stdout, /successfully/); + try { + this.retries(4); + await delay(this.test); + const stdout = execSync( + `node instantiateInlineWorkflowTemplate.js "${projectId}" "${region}"` + ); + assert.match(stdout, /successfully/); + } catch (err) { + if ( + err?.message?.includes('QUOTA') || + err?.message?.includes('RESOURCE_EXHAUSTED') || + err?.message?.includes('DISKS_TOTAL_GB') + ) { + console.warn( + `Quota limit reached in project ${projectId}. Skipping test.` + ); + this.skip(); + } else { + throw err; + } + } }); }); diff --git a/dataproc/system-test/submitJob.test.js b/dataproc/system-test/submitJob.test.js index e62c29e1b5..94f16eb672 100644 --- a/dataproc/system-test/submitJob.test.js +++ b/dataproc/system-test/submitJob.test.js @@ -51,9 +51,24 @@ const execSync = cmd => }); describe('submit a Spark job to a Dataproc cluster', () => { - before(async () => { - const [operation] = await clusterClient.createCluster(cluster); - await operation.promise(); + before(async function () { + try { + const [operation] = await clusterClient.createCluster(cluster); + await operation.promise(); + } catch (err) { + if ( + err?.message?.includes('QUOTA') || + err?.message?.includes('RESOURCE_EXHAUSTED') || + err?.message?.includes('DISKS_TOTAL_GB') + ) { + console.warn( + `Quota limit reached in project ${projectId}. Skipping test.` + ); + this.skip(); + } else { + throw err; + } + } }); it('should submit a job to a dataproc cluster', async () => { From 74d7befa33cf0bc04a73995d8361aee0d483eb81 Mon Sep 17 00:00:00 2001 From: Angel Caamal Date: Fri, 19 Jun 2026 20:25:53 +0000 Subject: [PATCH 2/3] Added error handling to test cleanup. --- dataproc/system-test/createCluster.test.js | 14 +++++++++----- dataproc/system-test/submitJob.test.js | 14 +++++++++----- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/dataproc/system-test/createCluster.test.js b/dataproc/system-test/createCluster.test.js index 449c5c48e7..ae311e46db 100644 --- a/dataproc/system-test/createCluster.test.js +++ b/dataproc/system-test/createCluster.test.js @@ -58,10 +58,14 @@ describe('create a dataproc cluster', () => { }); after(async () => { - await clusterClient.deleteCluster({ - projectId: projectId, - region: region, - clusterName: clusterName, - }); + try { + await clusterClient.deleteCluster({ + projectId: projectId, + region: region, + clusterName: clusterName, + }); + } catch (err) { + // Ignore errors during cleanup + } }); }); diff --git a/dataproc/system-test/submitJob.test.js b/dataproc/system-test/submitJob.test.js index 94f16eb672..39a27f506a 100644 --- a/dataproc/system-test/submitJob.test.js +++ b/dataproc/system-test/submitJob.test.js @@ -79,10 +79,14 @@ describe('submit a Spark job to a Dataproc cluster', () => { }); after(async () => { - await clusterClient.deleteCluster({ - projectId: projectId, - region: region, - clusterName: clusterName, - }); + try { + await clusterClient.deleteCluster({ + projectId: projectId, + region: region, + clusterName: clusterName, + }); + } catch (err) { + // Ignore errors during cleanup + } }); }); From 985c56c3875fe5035221bbf1eedbec44b0050202 Mon Sep 17 00:00:00 2001 From: Angel Caamal Date: Fri, 19 Jun 2026 20:31:54 +0000 Subject: [PATCH 3/3] Added error handling to quickstart.test.js --- dataproc/system-test/quickstart.test.js | 31 ++++++++++++++++++------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/dataproc/system-test/quickstart.test.js b/dataproc/system-test/quickstart.test.js index 56c1b29963..954cd07656 100644 --- a/dataproc/system-test/quickstart.test.js +++ b/dataproc/system-test/quickstart.test.js @@ -55,14 +55,29 @@ describe('execute the quickstart', () => { }); it('should execute the quickstart', async function () { - this.retries(4); - await delay(this.test); - const stdout = execSync( - `node quickstart.js "${projectId}" "${region}" "${clusterName}" "${jobFilePath}"` - ); - assert.match(stdout, /Cluster created successfully/); - assert.match(stdout, /Job finished successfully/); - assert.match(stdout, /successfully deleted/); + try { + this.retries(4); + await delay(this.test); + const stdout = execSync( + `node quickstart.js "${projectId}" "${region}" "${clusterName}" "${jobFilePath}"` + ); + assert.match(stdout, /Cluster created successfully/); + assert.match(stdout, /Job finished successfully/); + assert.match(stdout, /successfully deleted/); + } catch (err) { + if ( + err?.message?.includes('QUOTA') || + err?.message?.includes('RESOURCE_EXHAUSTED') || + err?.message?.includes('DISKS_TOTAL_GB') + ) { + console.warn( + `Quota limit reached in project ${projectId}. Skipping test.` + ); + this.skip(); + } else { + throw err; + } + } }); afterEach(async () => {