Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

fix(ci): prevent auth-tests timeout in critical-ui-tests workflow (#2084)

LearningCircuit23cb46b6d1f7
diff --git a/.github/workflows/critical-ui-tests.yml b/.github/workflows/critical-ui-tests.yml
index 91083b2c50..f762d86112 100644
--- a/.github/workflows/critical-ui-tests.yml
+++ b/.github/workflows/critical-ui-tests.yml
@@ -8,6 +8,12 @@ on:
permissions:
contents: read
+# Cancel stale runs when a PR is updated — prevents resource contention
+# from multiple simultaneous runs on the same PR
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+ cancel-in-progress: true
+
# Split into 3 parallel jobs to:
# 1. Run faster (parallel execution)
# 2. Isolate tests that create databases from those that don't
@@ -174,6 +180,15 @@ jobs:
- name: Set up test directories
run: mkdir -p "$PWD/data/encrypted_databases"
+ - name: Initialize database
+ env:
+ TEST_ENV: true
+ LDR_DATA_DIR: ${{ github.workspace }}/data
+ LDR_DB_KDF_ITERATIONS: "1000"
+ working-directory: ${{ github.workspace }}/src
+ run: |
+ pdm run python "${{ github.workspace }}/scripts/ci/init_test_database.py"
+
- name: Start test server
env:
CI: true
diff --git a/tests/ui_tests/auth_helper.js b/tests/ui_tests/auth_helper.js
index 47f82c6760..bbc0f9b1a4 100644
--- a/tests/ui_tests/auth_helper.js
+++ b/tests/ui_tests/auth_helper.js
@@ -119,41 +119,34 @@ class AuthHelper {
/**
* Wait for server to become responsive
- * Uses fetch instead of page navigation to avoid Puppeteer complications
+ * Uses Node.js http.get instead of page.evaluate to avoid Puppeteer's
+ * protocolTimeout (600s) when the page is in a bad state after navigation failure.
*/
async _waitForServerReady(maxWaitMs = 120000, checkIntervalMs = 5000) {
+ const http = require('http');
const startTime = Date.now();
- let lastError = null;
console.log(` Waiting for server to become ready (max ${maxWaitMs/1000}s)...`);
while (Date.now() - startTime < maxWaitMs) {
try {
- // Try to fetch the base URL using page.evaluate to make HTTP request
- const response = await this.page.evaluate(async (url) => {
- try {
- const controller = new AbortController();
- const timeoutId = setTimeout(() => controller.abort(), 10000);
- const res = await fetch(url, {
- signal: controller.signal,
- credentials: 'include'
- });
- clearTimeout(timeoutId);
- return { ok: res.ok, status: res.status };
- } catch (e) {
- return { ok: false, error: e.message };
- }
- }, this.baseUrl);
+ const ok = await new Promise((resolve) => {
+ const req = http.get(this.baseUrl, { timeout: 10000 }, (res) => {
+ resolve(res.statusCode >= 200 && res.statusCode < 400);
+ res.resume(); // drain the response
+ });
+ req.on('error', () => resolve(false));
+ req.on('timeout', () => { req.destroy(); resolve(false); });
+ });
- if (response.ok) {
- console.log(` ✅ Server is ready (status: ${response.status})`);
+ if (ok) {
+ console.log(` ✅ Server is ready`);
return true;
}
- console.log(` Server response: ${JSON.stringify(response)}`);
- } catch (evalError) {
- lastError = evalError;
- console.log(` Server check error: ${evalError.message}`);
+ console.log(` Server not ready yet...`);
+ } catch (e) {
+ console.log(` Server check error: ${e.message}`);
}
await this._delay(checkIntervalMs);
diff --git a/tests/ui_tests/test_register_full_flow.js b/tests/ui_tests/test_register_full_flow.js
index 15315d3029..6745ddf96d 100644
--- a/tests/ui_tests/test_register_full_flow.js
+++ b/tests/ui_tests/test_register_full_flow.js
@@ -348,6 +348,11 @@ async function testRegisterFullFlow() {
// Uses AuthHelper for robust CI-compatible registration with proper timeouts
console.log('\n📋 Test 6: Full successful registration flow');
+ // Stop background JS (polling, WebSocket) on the validation test page
+ // before opening a new page for registration — prevents interference
+ // with the server on single-core CI runners
+ await page.goto('about:blank');
+
// Create a fresh page to ensure clean state
const freshPage = await browser.newPage();