@@ -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+
2630export 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