Skip to content

Commit 8d16aca

Browse files
committed
small improvements
1 parent 02f3547 commit 8d16aca

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

packages/app/tests/e2e/components/SavedSearchModalComponent.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ export class SavedSearchModalComponent {
8383
await this.addTag(tag);
8484
}
8585

86+
// Wait for submit button to be enabled (form might need validation time)
87+
await expect(this.submitButton).toBeEnabled({ timeout: 5000 });
88+
8689
// Start waiting for URL change BEFORE clicking submit to avoid race condition
8790
const urlPromise = this.page.waitForURL(/\/search\/[a-f0-9]+/, {
8891
timeout: 15000,

packages/app/tests/e2e/seed-clickhouse.ts

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -491,25 +491,44 @@ function generateK8sEventLogs(count: number = 20): string {
491491
return rows.join(',\n');
492492
}
493493

494-
const CLICKHOUSE_READY_TIMEOUT_SECONDS = 30;
494+
// CI can be slower, so use a longer timeout
495+
const CLICKHOUSE_READY_TIMEOUT_SECONDS = parseInt(
496+
process.env.E2E_CLICKHOUSE_READY_TIMEOUT || '60',
497+
10,
498+
);
495499

496500
async function waitForClickHouse(
497501
client: ReturnType<typeof createClickHouseClient>,
498502
): Promise<void> {
499503
console.log(' Waiting for ClickHouse to be ready...');
504+
console.log(
505+
` Attempting connection to: ${DEFAULT_CONFIG.host} (user: ${DEFAULT_CONFIG.user})`,
506+
);
507+
508+
let lastError: Error | null = null;
500509

501510
for (let attempt = 0; attempt < CLICKHOUSE_READY_TIMEOUT_SECONDS; attempt++) {
502511
try {
503512
await client.query('SELECT 1');
504513
console.log(' ClickHouse is ready');
505514
return;
506-
} catch {
515+
} catch (error) {
516+
lastError = error instanceof Error ? error : new Error(String(error));
517+
if (attempt % 5 === 0) {
518+
// Log every 5 seconds
519+
console.log(
520+
` Still waiting... (${attempt}/${CLICKHOUSE_READY_TIMEOUT_SECONDS}s)`,
521+
);
522+
}
507523
await new Promise(resolve => setTimeout(resolve, 1000));
508524
}
509525
}
510526

527+
console.error(' Last connection error:', lastError?.message);
511528
throw new Error(
512-
`ClickHouse not ready after ${CLICKHOUSE_READY_TIMEOUT_SECONDS} seconds`,
529+
`ClickHouse not ready after ${CLICKHOUSE_READY_TIMEOUT_SECONDS} seconds. ` +
530+
`Host: ${DEFAULT_CONFIG.host}. ` +
531+
`Last error: ${lastError?.message || 'Unknown'}`,
513532
);
514533
}
515534

0 commit comments

Comments
 (0)