Skip to content

Commit 96c9768

Browse files
KSDaemonigorlukanin
authored andcommitted
chore(ci): Increase jest timeout for redshift tests to be able to pass (#10063)
* chore(ci): Increase jest timeout for redshift tests to be able to pass * set CUBEJS_DB_MAX_POOL for Redshift Tests * add delays between pre-aggs build * decrease CUBEJS_DB_MAX_POOL * decrease CUBEJS_DB_MAX_POOL * add delay between create tables queries * more delays for redshift * more timeout adjustments * increase timeouts * comment put heavy tests * skip tests for tesseract
1 parent 0047d1b commit 96c9768

File tree

2 files changed

+40
-3
lines changed

2 files changed

+40
-3
lines changed

packages/cubejs-testing-drivers/fixtures/redshift.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
"CUBEJS_DB_NAME": "dev",
2525
"CUBEJS_DB_USER": "${DRIVERS_TESTS_CUBEJS_DB_REDSHIFT_USER}",
2626
"CUBEJS_DB_PASS": "${DRIVERS_TESTS_CUBEJS_DB_REDSHIFT_PASS}",
27+
"CUBEJS_DB_MAX_POOL": "2",
28+
"CUBEJS_DB_QUERY_TIMEOUT": "15m",
2729

2830
"CUBEJS_PG_SQL_PORT": "5656",
2931
"CUBEJS_SQL_USER": "admin",
@@ -193,7 +195,11 @@
193195
"---------------------------------------",
194196
"SKIPPED SQL API (Need work) ",
195197
"---------------------------------------",
196-
"SQL API: SQL push down push to cube quoted alias"
198+
"SQL API: SQL push down push to cube quoted alias",
199+
200+
"Skipped because are too heavy and leads to Connection terminated unexpectedly or ECONNREFUSED or ECONNRESET",
201+
"SQL API: Rolling Window YTD (year + month + day + date_trunc equal)",
202+
"SQL API: Rolling Window YTD (year + month + day + date_trunc IN)"
197203
],
198204
"tesseractSkip": [
199205
"querying custom granularities ECommerce: count by three_months_by_march + no dimension",
@@ -226,6 +232,10 @@
226232
"---- Different results comparing to baseQuery version. Need to investigate ----",
227233
"querying BigECommerce: rolling window YTD (month + week)",
228234
"querying BigECommerce: rolling window YTD (month + week + no gran)",
229-
"querying BigECommerce: rolling window YTD without granularity"
235+
"querying BigECommerce: rolling window YTD without granularity",
236+
237+
"Skipped because are too heavy and leads to Connection terminated unexpectedly or ECONNREFUSED or ECONNRESET",
238+
"SQL API: Rolling Window YTD (year + month + day + date_trunc equal)",
239+
"SQL API: Rolling Window YTD (year + month + day + date_trunc IN)"
230240
]
231241
}

packages/cubejs-testing-drivers/src/tests/testQueries.ts

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,17 @@ type TestQueriesOptions = {
2323
externalSchemaTests?: boolean,
2424
};
2525

26+
export const delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
27+
28+
const OP_DELAY = 1000;
29+
2630
export function testQueries(type: string, { includeIncrementalSchemaSuite, extendedEnv, includeHLLSuite, externalSchemaTests }: TestQueriesOptions = {}): void {
2731
describe(`Queries with the @cubejs-backend/${type}-driver${extendedEnv ? ` ${extendedEnv}` : ''}`, () => {
28-
jest.setTimeout(60 * 5 * 1000);
32+
if (type.includes('redshift')) {
33+
jest.setTimeout(60 * 15 * 1000);
34+
} else {
35+
jest.setTimeout(60 * 5 * 1000);
36+
}
2937

3038
const isTesseractEnv = get('DRIVERS_TESTS_CUBEJS_TESSERACT_SQL_PLANNER').default('false').asBool();
3139

@@ -94,6 +102,10 @@ export function testQueries(type: string, { includeIncrementalSchemaSuite, exten
94102
await test(connection);
95103
} finally {
96104
await connection.end();
105+
106+
if (type.includes('redshift')) {
107+
await delay(OP_DELAY);
108+
}
97109
}
98110
});
99111
}
@@ -127,6 +139,9 @@ export function testQueries(type: string, { includeIncrementalSchemaSuite, exten
127139
try {
128140
for (const q of queries) {
129141
await driver.createTableRaw(q);
142+
if (type.includes('redshift')) {
143+
await delay(10 * OP_DELAY);
144+
}
130145
}
131146
console.log(`Creating ${queries.length} fixture tables completed`);
132147
} catch (e: any) {
@@ -156,36 +171,48 @@ export function testQueries(type: string, { includeIncrementalSchemaSuite, exten
156171
contexts: [{ securityContext: { tenant: 't1' } }],
157172
});
158173

174+
await delay(OP_DELAY);
175+
159176
await buildPreaggs(env.cube.port, apiToken, {
160177
timezones: ['UTC'],
161178
preAggregations: ['ECommerce.SAExternal'],
162179
contexts: [{ securityContext: { tenant: 't1' } }],
163180
});
164181

182+
await delay(OP_DELAY);
183+
165184
await buildPreaggs(env.cube.port, apiToken, {
166185
timezones: ['UTC'],
167186
preAggregations: ['ECommerce.TAExternal'],
168187
contexts: [{ securityContext: { tenant: 't1' } }],
169188
});
170189

190+
await delay(OP_DELAY);
191+
171192
await buildPreaggs(env.cube.port, apiToken, {
172193
timezones: ['UTC'],
173194
preAggregations: ['BigECommerce.TAExternal'],
174195
contexts: [{ securityContext: { tenant: 't1' } }],
175196
});
176197

198+
await delay(OP_DELAY);
199+
177200
await buildPreaggs(env.cube.port, apiToken, {
178201
timezones: ['UTC'],
179202
preAggregations: ['BigECommerce.MultiTimeDimForCountExternal'],
180203
contexts: [{ securityContext: { tenant: 't1' } }],
181204
});
182205

206+
await delay(OP_DELAY);
207+
183208
if (includeHLLSuite) {
184209
await buildPreaggs(env.cube.port, apiToken, {
185210
timezones: ['UTC'],
186211
preAggregations: ['BigECommerce.CountByProductExternal'],
187212
contexts: [{ securityContext: { tenant: 't1' } }],
188213
});
214+
215+
await delay(OP_DELAY);
189216
}
190217
});
191218

0 commit comments

Comments
 (0)