diff --git a/packages/cubejs-testing-drivers/fixtures/redshift.json b/packages/cubejs-testing-drivers/fixtures/redshift.json index 0bdfbe1db1136..6d6f027e3202b 100644 --- a/packages/cubejs-testing-drivers/fixtures/redshift.json +++ b/packages/cubejs-testing-drivers/fixtures/redshift.json @@ -24,6 +24,8 @@ "CUBEJS_DB_NAME": "dev", "CUBEJS_DB_USER": "${DRIVERS_TESTS_CUBEJS_DB_REDSHIFT_USER}", "CUBEJS_DB_PASS": "${DRIVERS_TESTS_CUBEJS_DB_REDSHIFT_PASS}", + "CUBEJS_DB_MAX_POOL": "2", + "CUBEJS_DB_QUERY_TIMEOUT": "15m", "CUBEJS_PG_SQL_PORT": "5656", "CUBEJS_SQL_USER": "admin", @@ -193,7 +195,11 @@ "---------------------------------------", "SKIPPED SQL API (Need work) ", "---------------------------------------", - "SQL API: SQL push down push to cube quoted alias" + "SQL API: SQL push down push to cube quoted alias", + + "Skipped because are too heavy and leads to Connection terminated unexpectedly or ECONNREFUSED or ECONNRESET", + "SQL API: Rolling Window YTD (year + month + day + date_trunc equal)", + "SQL API: Rolling Window YTD (year + month + day + date_trunc IN)" ], "tesseractSkip": [ "querying custom granularities ECommerce: count by three_months_by_march + no dimension", @@ -226,6 +232,10 @@ "---- Different results comparing to baseQuery version. Need to investigate ----", "querying BigECommerce: rolling window YTD (month + week)", "querying BigECommerce: rolling window YTD (month + week + no gran)", - "querying BigECommerce: rolling window YTD without granularity" + "querying BigECommerce: rolling window YTD without granularity", + + "Skipped because are too heavy and leads to Connection terminated unexpectedly or ECONNREFUSED or ECONNRESET", + "SQL API: Rolling Window YTD (year + month + day + date_trunc equal)", + "SQL API: Rolling Window YTD (year + month + day + date_trunc IN)" ] } diff --git a/packages/cubejs-testing-drivers/src/tests/testQueries.ts b/packages/cubejs-testing-drivers/src/tests/testQueries.ts index 1c09b2f53178d..d5304e24a0a29 100644 --- a/packages/cubejs-testing-drivers/src/tests/testQueries.ts +++ b/packages/cubejs-testing-drivers/src/tests/testQueries.ts @@ -23,9 +23,17 @@ type TestQueriesOptions = { externalSchemaTests?: boolean, }; +export const delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); + +const OP_DELAY = 1000; + export function testQueries(type: string, { includeIncrementalSchemaSuite, extendedEnv, includeHLLSuite, externalSchemaTests }: TestQueriesOptions = {}): void { describe(`Queries with the @cubejs-backend/${type}-driver${extendedEnv ? ` ${extendedEnv}` : ''}`, () => { - jest.setTimeout(60 * 5 * 1000); + if (type.includes('redshift')) { + jest.setTimeout(60 * 15 * 1000); + } else { + jest.setTimeout(60 * 5 * 1000); + } const isTesseractEnv = get('DRIVERS_TESTS_CUBEJS_TESSERACT_SQL_PLANNER').default('false').asBool(); @@ -94,6 +102,10 @@ export function testQueries(type: string, { includeIncrementalSchemaSuite, exten await test(connection); } finally { await connection.end(); + + if (type.includes('redshift')) { + await delay(OP_DELAY); + } } }); } @@ -127,6 +139,9 @@ export function testQueries(type: string, { includeIncrementalSchemaSuite, exten try { for (const q of queries) { await driver.createTableRaw(q); + if (type.includes('redshift')) { + await delay(10 * OP_DELAY); + } } console.log(`Creating ${queries.length} fixture tables completed`); } catch (e: any) { @@ -156,36 +171,48 @@ export function testQueries(type: string, { includeIncrementalSchemaSuite, exten contexts: [{ securityContext: { tenant: 't1' } }], }); + await delay(OP_DELAY); + await buildPreaggs(env.cube.port, apiToken, { timezones: ['UTC'], preAggregations: ['ECommerce.SAExternal'], contexts: [{ securityContext: { tenant: 't1' } }], }); + await delay(OP_DELAY); + await buildPreaggs(env.cube.port, apiToken, { timezones: ['UTC'], preAggregations: ['ECommerce.TAExternal'], contexts: [{ securityContext: { tenant: 't1' } }], }); + await delay(OP_DELAY); + await buildPreaggs(env.cube.port, apiToken, { timezones: ['UTC'], preAggregations: ['BigECommerce.TAExternal'], contexts: [{ securityContext: { tenant: 't1' } }], }); + await delay(OP_DELAY); + await buildPreaggs(env.cube.port, apiToken, { timezones: ['UTC'], preAggregations: ['BigECommerce.MultiTimeDimForCountExternal'], contexts: [{ securityContext: { tenant: 't1' } }], }); + await delay(OP_DELAY); + if (includeHLLSuite) { await buildPreaggs(env.cube.port, apiToken, { timezones: ['UTC'], preAggregations: ['BigECommerce.CountByProductExternal'], contexts: [{ securityContext: { tenant: 't1' } }], }); + + await delay(OP_DELAY); } });