Skip to content

Commit 8032cf3

Browse files
author
Guiners
committed
adding delay and retries for textgen tests
1 parent 792f37b commit 8032cf3

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

genai/test/textgen-with-local-video.test.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,13 @@ const {describe, it} = require('mocha');
1919

2020
const projectId = process.env.CAIP_PROJECT_ID;
2121
const sample = require('../text-generation/textgen-with-local-video.js');
22+
const {delay} = require('./util');
2223

2324
describe('textgen-with-local-video', async () => {
2425
it('should generate text content from local video', async function () {
25-
this.timeout(30000);
26+
this.timeout(180000);
27+
this.retries(5);
28+
await delay(this.test);
2629
const output = await sample.generateText(projectId);
2730
assert(output.length > 0);
2831
});

genai/test/textgen-with-multi-img.test.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,13 @@ const {describe, it} = require('mocha');
1919

2020
const projectId = process.env.CAIP_PROJECT_ID;
2121
const sample = require('../text-generation/textgen-with-multi-img.js');
22+
const {delay} = require('./util');
2223

2324
describe('textgen-with-multi-img', () => {
2425
it('should generate text content from a text prompt and multiple images', async function () {
2526
this.timeout(180000);
27+
this.retries(5);
28+
await delay(this.test);
2629
const output = await sample.generateContent(projectId);
2730
console.log('Generated output:', output);
2831

genai/test/textgen-with-multi-local-img.test.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,13 @@ const projectId = process.env.CAIP_PROJECT_ID;
2121
const location = process.env.GOOGLE_CLOUD_LOCATION || 'global';
2222

2323
const sample = require('../text-generation/textgen-with-multi-local-img.js');
24+
const {delay} = require('./util');
2425

2526
describe('textgen-with-multi-local-img', () => {
2627
it('should generate text content from multiple images', async function () {
27-
this.timeout(100000);
28+
this.timeout(180000);
29+
this.retries(5);
30+
await delay(this.test);
2831
const imagePath1 = './test-data/latte.jpg';
2932
const imagePath2 = './test-data/scones.jpg';
3033
const output = await sample.generateContent(

0 commit comments

Comments
 (0)