Skip to content

Commit 0566b64

Browse files
committed
add delays between pre-aggs build
1 parent 49b2274 commit 0566b64

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ type TestQueriesOptions = {
2323
externalSchemaTests?: boolean,
2424
};
2525

26+
export const delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
27+
2628
export function testQueries(type: string, { includeIncrementalSchemaSuite, extendedEnv, includeHLLSuite, externalSchemaTests }: TestQueriesOptions = {}): void {
2729
describe(`Queries with the @cubejs-backend/${type}-driver${extendedEnv ? ` ${extendedEnv}` : ''}`, () => {
2830
jest.setTimeout(60 * 7 * 1000);
@@ -156,36 +158,48 @@ export function testQueries(type: string, { includeIncrementalSchemaSuite, exten
156158
contexts: [{ securityContext: { tenant: 't1' } }],
157159
});
158160

161+
await delay(2000);
162+
159163
await buildPreaggs(env.cube.port, apiToken, {
160164
timezones: ['UTC'],
161165
preAggregations: ['ECommerce.SAExternal'],
162166
contexts: [{ securityContext: { tenant: 't1' } }],
163167
});
164168

169+
await delay(2000);
170+
165171
await buildPreaggs(env.cube.port, apiToken, {
166172
timezones: ['UTC'],
167173
preAggregations: ['ECommerce.TAExternal'],
168174
contexts: [{ securityContext: { tenant: 't1' } }],
169175
});
170176

177+
await delay(2000);
178+
171179
await buildPreaggs(env.cube.port, apiToken, {
172180
timezones: ['UTC'],
173181
preAggregations: ['BigECommerce.TAExternal'],
174182
contexts: [{ securityContext: { tenant: 't1' } }],
175183
});
176184

185+
await delay(2000);
186+
177187
await buildPreaggs(env.cube.port, apiToken, {
178188
timezones: ['UTC'],
179189
preAggregations: ['BigECommerce.MultiTimeDimForCountExternal'],
180190
contexts: [{ securityContext: { tenant: 't1' } }],
181191
});
182192

193+
await delay(2000);
194+
183195
if (includeHLLSuite) {
184196
await buildPreaggs(env.cube.port, apiToken, {
185197
timezones: ['UTC'],
186198
preAggregations: ['BigECommerce.CountByProductExternal'],
187199
contexts: [{ securityContext: { tenant: 't1' } }],
188200
});
201+
202+
await delay(2000);
189203
}
190204
});
191205

0 commit comments

Comments
 (0)