From d6c24b6de8af9b41c0636e6cdb377f097c638526 Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Tue, 19 Jan 2021 15:52:24 -0800 Subject: [PATCH] build: increase retries and timeout for flaky tests (#60) * build: increase retries and timeout for flaky tests --- ai-platform/snippets/package.json | 2 +- .../test/create-training-pipeline-image-classification.test.js | 3 ++- .../create-training-pipeline-image-object-detection.test.js | 3 ++- .../create-training-pipeline-tabular-classification.test.js | 3 ++- .../test/create-training-pipeline-tabular-regression.test.js | 3 ++- .../test/create-training-pipeline-text-classification.test.js | 3 ++- .../create-training-pipeline-text-entity-extraction.test.js | 3 ++- .../create-training-pipeline-text-sentiment-analysis.test.js | 3 ++- .../test/create-training-pipeline-video-classification.test.js | 3 ++- .../create-training-pipeline-video-object-tracking.test.js | 3 ++- .../snippets/test/predict-image-object-detection.test.js | 3 ++- 11 files changed, 21 insertions(+), 11 deletions(-) diff --git a/ai-platform/snippets/package.json b/ai-platform/snippets/package.json index 56470bfc68..8098c74ae5 100644 --- a/ai-platform/snippets/package.json +++ b/ai-platform/snippets/package.json @@ -10,7 +10,7 @@ "*.js" ], "scripts": { - "test": "mocha --timeout 600000 test/*.js" + "test": "mocha --timeout 800000 test/*.js" }, "dependencies": { "@google-cloud/aiplatform": "^1.3.0" diff --git a/ai-platform/snippets/test/create-training-pipeline-image-classification.test.js b/ai-platform/snippets/test/create-training-pipeline-image-classification.test.js index 85e7f67f57..f414d000ea 100644 --- a/ai-platform/snippets/test/create-training-pipeline-image-classification.test.js +++ b/ai-platform/snippets/test/create-training-pipeline-image-classification.test.js @@ -40,7 +40,8 @@ const project = process.env.CAIP_PROJECT_ID; let trainingPipelineId; -describe('AI platform create training pipeline image classification', () => { +describe('AI platform create training pipeline image classification', async function () { + this.retries(2); it('should create a new image classification training pipeline', async () => { const stdout = execSync( `node ./create-training-pipeline-image-classification.js ${datasetId} ${modelDisplayName} ${trainingPipelineDisplayName} ${project} ${location}` diff --git a/ai-platform/snippets/test/create-training-pipeline-image-object-detection.test.js b/ai-platform/snippets/test/create-training-pipeline-image-object-detection.test.js index 0f463e82a4..ea7cd6ceeb 100644 --- a/ai-platform/snippets/test/create-training-pipeline-image-object-detection.test.js +++ b/ai-platform/snippets/test/create-training-pipeline-image-object-detection.test.js @@ -42,7 +42,8 @@ const project = process.env.CAIP_PROJECT_ID; let trainingPipelineId; -describe('AI platform create training pipeline image object detection', () => { +describe('AI platform create training pipeline image object detection', async function () { + this.retries(2); it('should create a new image object detection training pipeline', async () => { const stdout = execSync( `node ./create-training-pipeline-image-object-detection.js \ diff --git a/ai-platform/snippets/test/create-training-pipeline-tabular-classification.test.js b/ai-platform/snippets/test/create-training-pipeline-tabular-classification.test.js index 2a9d5c9b88..2fc65492fb 100644 --- a/ai-platform/snippets/test/create-training-pipeline-tabular-classification.test.js +++ b/ai-platform/snippets/test/create-training-pipeline-tabular-classification.test.js @@ -43,7 +43,8 @@ const project = process.env.CAIP_PROJECT_ID; let trainingPipelineId; -describe('AI platform create training pipeline tables classification', () => { +describe('AI platform create training pipeline tables classification', async function () { + this.retries(2); it('should create a new tables classification training pipeline', async () => { const stdout = execSync( `node ./create-training-pipeline-tabular-classification.js \ diff --git a/ai-platform/snippets/test/create-training-pipeline-tabular-regression.test.js b/ai-platform/snippets/test/create-training-pipeline-tabular-regression.test.js index 90c386bb22..3fa92b3095 100644 --- a/ai-platform/snippets/test/create-training-pipeline-tabular-regression.test.js +++ b/ai-platform/snippets/test/create-training-pipeline-tabular-regression.test.js @@ -43,7 +43,8 @@ const project = process.env.CAIP_PROJECT_ID; let trainingPipelineId; -describe('AI platform create training pipeline tabular regression', () => { +describe('AI platform create training pipeline tabular regression', async function () { + this.retries(2); it('should create a new tabular regression training pipeline', async () => { const stdout = execSync( `node ./create-training-pipeline-tabular-regression.js \ diff --git a/ai-platform/snippets/test/create-training-pipeline-text-classification.test.js b/ai-platform/snippets/test/create-training-pipeline-text-classification.test.js index f9d09e6e59..cbcd4d8658 100644 --- a/ai-platform/snippets/test/create-training-pipeline-text-classification.test.js +++ b/ai-platform/snippets/test/create-training-pipeline-text-classification.test.js @@ -42,7 +42,8 @@ const project = process.env.CAIP_PROJECT_ID; let trainingPipelineId; -describe('AI platform create training pipeline text classification', () => { +describe('AI platform create training pipeline text classification', async function () { + this.retries(2); it('should create a new text classification training pipeline', async () => { const stdout = execSync( `node ./create-training-pipeline-text-classification.js \ diff --git a/ai-platform/snippets/test/create-training-pipeline-text-entity-extraction.test.js b/ai-platform/snippets/test/create-training-pipeline-text-entity-extraction.test.js index 6e22f7a2b6..c7cec5eca1 100644 --- a/ai-platform/snippets/test/create-training-pipeline-text-entity-extraction.test.js +++ b/ai-platform/snippets/test/create-training-pipeline-text-entity-extraction.test.js @@ -42,7 +42,8 @@ const project = process.env.CAIP_PROJECT_ID; let trainingPipelineId; -describe('AI platform create training pipeline text entity extraction', () => { +describe('AI platform create training pipeline text entity extraction', async function () { + this.retries(2); it('should create a new text entity extraction training pipeline', async () => { const stdout = execSync( `node ./create-training-pipeline-text-entity-extraction.js \ diff --git a/ai-platform/snippets/test/create-training-pipeline-text-sentiment-analysis.test.js b/ai-platform/snippets/test/create-training-pipeline-text-sentiment-analysis.test.js index 4b41cdc8f6..d47d55e588 100644 --- a/ai-platform/snippets/test/create-training-pipeline-text-sentiment-analysis.test.js +++ b/ai-platform/snippets/test/create-training-pipeline-text-sentiment-analysis.test.js @@ -42,7 +42,8 @@ const project = process.env.CAIP_PROJECT_ID; let trainingPipelineId; -describe('AI platform create training pipeline text sentiment analysis', () => { +describe('AI platform create training pipeline text sentiment analysis', async function () { + this.retries(2); it('should create a new text sentiment analysis training pipeline', async () => { const stdout = execSync( `node ./create-training-pipeline-text-sentiment-analysis.js \ diff --git a/ai-platform/snippets/test/create-training-pipeline-video-classification.test.js b/ai-platform/snippets/test/create-training-pipeline-video-classification.test.js index f57045e07f..f098b1c0ed 100644 --- a/ai-platform/snippets/test/create-training-pipeline-video-classification.test.js +++ b/ai-platform/snippets/test/create-training-pipeline-video-classification.test.js @@ -42,7 +42,8 @@ const project = process.env.CAIP_PROJECT_ID; let trainingPipelineId; -describe('AI platform create training pipeline video classification', () => { +describe('AI platform create training pipeline video classification', async function () { + this.retries(2); it('should create a new video classification training pipeline', async () => { const stdout = execSync( `node ./create-training-pipeline-video-classification.js ${datasetId} \ diff --git a/ai-platform/snippets/test/create-training-pipeline-video-object-tracking.test.js b/ai-platform/snippets/test/create-training-pipeline-video-object-tracking.test.js index 08f15d46f6..bfa2810707 100644 --- a/ai-platform/snippets/test/create-training-pipeline-video-object-tracking.test.js +++ b/ai-platform/snippets/test/create-training-pipeline-video-object-tracking.test.js @@ -42,7 +42,8 @@ const project = process.env.CAIP_PROJECT_ID; let trainingPipelineId; -describe('AI platform create training pipeline object tracking', () => { +describe('AI platform create training pipeline object tracking', async function () { + this.retries(2); it('should create a new object tracking training pipeline', async () => { const stdout = execSync( `node ./create-training-pipeline-video-object-tracking.js \ diff --git a/ai-platform/snippets/test/predict-image-object-detection.test.js b/ai-platform/snippets/test/predict-image-object-detection.test.js index 1ea00ae1a4..d482ea5564 100644 --- a/ai-platform/snippets/test/predict-image-object-detection.test.js +++ b/ai-platform/snippets/test/predict-image-object-detection.test.js @@ -29,7 +29,8 @@ const endpointId = '2791387344039575552'; const project = process.env.CAIP_PROJECT_ID; const location = 'us-central1'; -describe('AI platform predict image object detection', () => { +describe('AI platform predict image object detection', async function () { + this.retries(2); it('should make predictions using the image object detection model', async () => { const stdout = execSync( `node ./predict-image-object-detection.js ${filename} \